1 public class Solution {
2 public int[] twoSum(
int[] numbers,
int target) {
3 // Start typing your Java solution below
4 // DO NOT write main() function
5 int result[] =
new int[2
];
6 int tags = 0
;
7 for (
int i = 0; i < numbers.length && tags == 0; i++
)
8 for (
int j = i + 1; j < numbers.length && tags == 0; j++
)
9 {
10 if (numbers[i] + numbers[j] ==
target)
11 {
12 result[0] = i + 1
;
13 result[1] = j + 1
;
14 tags = 1
;
15 }
16 }
17 return result;
18 }
19 }吐槽:为什么Accepted之后,仍然显示0/132? 而且代码不保存记录?
转载于:https://www.cnblogs.com/leiatpku/p/3164418.html