力扣题库:两数之和

c语言版本

int* twoSum(int* nums, int numsSize, int target) {
static  int a[2]= { 0 };
int i, j;
for (i=0;i

c++版本

class Solution {
public:
 vector twoSum(vector& nums, int target) {
    
    vector res;
    int len=nums.size();
    for(int i=0;i

你可能感兴趣的:(LeetCode)