解析:两个for遍历数组
class Solution {
public int[] twoSum(int[] nums, int target) {
int[] b = new int[2];
for (int i = 0; i <= nums.length - 2; i++) {
for (int j = i + 1; j <= nums.length - 1; j++) {
if (nums[i] + nums[j] == target) {
int[] a = {i, j};
b = a;
}
}
}
return b;
}
}