Given an array, and a value K as input, we have to find a pair of elements such that their sum is K.
There are multiple ways of solving this problem. We will discuss some of them in this post. Let us implement the function which prints the two values such that array[i] + array[j] = K if there is such a pair exists. If not print "No such pair".
Read full article from Problem solving with programming: Given an array, find two values in the array which sum upto a value K
No comments:
Post a Comment