Given nums = [2, 7, 11, 15], target = 9,Because nums[0] + nums[1] = 2 + 7 = 9,return [0, 1].
public int[] twoSum(int[] nums, int target) { int [] result=new int[2]; for(int i=0;i
本文共 248 字,大约阅读时间需要 1 分钟。
Given nums = [2, 7, 11, 15], target = 9,Because nums[0] + nums[1] = 2 + 7 = 9,return [0, 1].
public int[] twoSum(int[] nums, int target) { int [] result=new int[2]; for(int i=0;i
转载于:https://www.cnblogs.com/kingshine007/p/8512004.html