This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Given an unsorted array A[]. The task is to print all unique pairs in the unsorted array with equal sum. | |
Note: Print the result in the format as shown in the below examples. | |
Examples: | |
Input: A[] = { 6, 4, 12, 10, 22, 54, 32, 42, 21, 11} | |
Output: | |
Pairs : ( 4, 12) ( 6, 10) have sum : 16 | |
Pairs : ( 10, 22) ( 21, 11) have sum : 32 | |
Pairs : ( 12, 21) ( 22, 11) have sum : 33 |