var twoSum = function (nums, target) { let r1 = (r2 = 0); for (let o = 0; o < nums.length; o++) { for (let i = o + 1; i < nums.length; i++) { if (nums[o] + nums[i] === target) { r1 = o; r2 = i; } } } return [r1, r2];}
欢迎分享,转载请注明来源:内存溢出
var twoSum = function (nums, target) { let r1 = (r2 = 0); for (let o = 0; o < nums.length; o++) { for (let i = o + 1; i < nums.length; i++) { if (nums[o] + nums[i] === target) { r1 = o; r2 = i; } } } return [r1, r2];}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)