Count Pairs With Given Sum
Given an integer array of size n, and an integer ‘K’, you need to count the number of pairs(need not to be unique) present in the array whose sum is equal to ‘K’. Example Input: Arr={1, 5, 7, 1} K=6 Output: 2 Brute force solution for Count Pairs With Given Sum Main idea …