Given a list of numbers and a number k, return whether any two numbers from the list add up to k
This question can be easily solved with the help of set in O(N) time and space complexity.First add all the elements of array into set and then traverse each element of array and check whether K-ar[i] is present in set or not. Here is the code in java with O(N) complexity : boolean flag=false; HashSet<Long> … Read more