Loading Similar Posts
Problem Statement:
You are given a list of integers. Write a program which prints all the integer pairs in the list that repeat. If the list has more than one such pair, print all the pairs in consecutive lines in a sorted order. Sorting should be performed on the first integer of the pair.
Read the input from STDIN and print the output to STDOUT. Do not write arbitrary strings while reading the input or while printing, as these contribute to the standard output and test cases will fail.
Input Format:
Output Format:
Constraints:
Sample Input 1:
5
1 2 3 1 2
Sample Output 1:
1 2
Explanation 1:
Since 1 2 is repeating in the list, it forms a couple. Hence the output is 1 2.