Skip to content

Instantly share code, notes, and snippets.

@DhruvaG2000
Created September 1, 2020 17:47
Show Gist options
  • Save DhruvaG2000/81f1c364649b95ebb6418e627fc7c169 to your computer and use it in GitHub Desktop.
Save DhruvaG2000/81f1c364649b95ebb6418e627fc7c169 to your computer and use it in GitHub Desktop.
int* twoSum(int* nums, int numsSize, int target, int* returnSize){
int first_num=nums[0], second_num=nums[1], index_of_first_num=0, index_of_second_num=1;
for (int i = 0; i < sizeof(nums); i++)
{
first_num=nums[i];
for (int j = 0; j < sizeof(nums); j++)
{
second_num=nums[j];
/* code */
if ((first_num+second_num)==9)
{
index_of_first_num=i;
index_of_second_num=j;
}
}
}
int temparr[]={index_of_first_num,index_of_second_num};
return temparr;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment