Check if pair with given Sum exists in Array (Two Sum)
You are given an array of integers and sum. You have to find out if there exist a pair of sum is equal to that sum or not. Print “Yes” if exist, else “No”. Examples: Input: 1,2,2,4,4 Sum:8 Output: Yes Input: 2,3,4,5 Sum:6 Output: No Approach-1: Brute Force method: In this method we iterate two for loops just… Read More »
