Created
September 1, 2020 17:47
-
-
Save DhruvaG2000/81f1c364649b95ebb6418e627fc7c169 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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