C++版:
class Solution { public: vectortwoSum(vector & nums, int target) { int i,j; vector s; for(i=0;i python版:
class Solution(object): def twoSum(self, nums, target): """ :type nums: List[int] :type target: int :rtype: List[int] """ n = len(nums) for x in range(n): for y in range(x+1,n): if(nums[x]+nums[y]==target): return x,y欢迎分享,转载请注明来源:内存溢出
评论列表(0条)