Repeating & Non-Repeating Numbers
Given a list of numbers, find and print, the first number that occurs only once in the list and the first number that occurs more than once in the list.
Input
The input will be a single line containing space-separated integers.
Output
The first line of the output should contain the first non-repeating number. The second line of output should contain first repeating number. If there is no number fitting the given criteria, print "None" instead.
Explanation
For example, if the given list of integers are 5, 5, 4, 7, 4, 1, 11 , the first non-repeating number is 7 and the first repeating number is 5.
Sample Input 1
5 5 4 7 4 1 11
Sample Output 1
7
5
Sample Input 2
1 2 3 4 5 6 7 8 9
Sample Output 2
1
None
Comments
Leave a comment