Company: Infoedge_12oct
Difficulty: medium
Sum-Two Pairs Problem Description Recently you were taught about the importance of double pairs. Double pairs are pairs of 2 numbers, such that one of them is double the other. You are given an array, wherein all integers are unique. You have to find the number of such pairs. Return the number of such pairs. Input Format: The first line consists of an integer, N. The next N lines are array elements. Output Format: The output should be an integer, denoting the number of such double pairs in the array. Examples Example 1: Input: 5 6 7 12 14 28 Output: 3 Explanation: We see the following 3 pairs : (6-12), (7-14) and (14-28) hence the number of pairs is 3. Example 2: Input: 4 1 2 4 8 Output: 3 Explanation: (1, 2) (2, 4) (4, 8) Constraints The number of array elements N: 1 ≤ N ≤ 10 4 . The array elements: arr[i]: 1 ≤ arr[i] ≤ 10 4 . Execution time limit: 10 seconds.