Given an array of n integers, find pair of numbers if present whose sum is equal to a given target sum.
Answers
Answered by
0
Step-by-step explanation:
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.
Similar questions
Social Sciences,
7 months ago
Math,
7 months ago
Physics,
7 months ago
Math,
1 year ago
Math,
1 year ago