Check if an array contains a number which is a sum of 2 numbers in that array
Answers
Answered by
0
Answer:
If sum of both the values are equal to given number then we output the pair and advance them.
If the sum of two numbers is less than k then we increase the left pointer, else if the sum is greater than k we decrement the right pointer, until both pointers meet at some part of the array
Answered by
11
Hiiii dude......
If sum of both the values are equal to given number then we output the pair and advance them.
Similar questions