暴力解法,用和減去一個數得到一個值必然在數組中,遍歷數組找到該值的下標即可 public static int[] twoSum(int[] numbers, int target) { // write code here int reduceNumber = 0; for (int i = 0; i < numbers.length; i++) { reduceNumber = target - numbers[i]; if (reduceNumber >= 0) { ...