/**
* Note: The returned array must be malloced, assume caller calls free().
*/
int* twoSum(int* nums, int numsSize, int target, int* returnSize){
//int len = numsSize/sizeof(int);
for (int i=0; i < numsSize-1; i++)
{
for (int j=i+1; j < numsSize; j++)
{
if (nums[i] + nums[j] == target)
{
int* ret = (int*)malloc(2*sizeof(int));
ret[0] = i;
ret[1] = j;
*returnSize = 2;
return ret;
}
}
}
return NULL;
}