Find four elements i,j,k and l in an array such that i+j=k+l
Answers
Answered by
1
Input: {3, 4, 7, 1, 2, 9, 8}
Output: (3, 8) and (4, 7)
Explanation: 3+8 = 4+7
Input: {3, 4, 7, 1, 12, 9};
Output: (4, 12) and (7, 9)
Explanation: 4+12 = 7+9
Input: {65, 30, 7, 90, 1, 9, 8};
Output: No pairs found
PLEASE MAKE ME AS A BRAINLIST ANSWER
Similar questions