NPTEL Programming Assignment: T1-Q1
You are given a sequence of positive integers, terminated with a -1. (The -1 is not part of the sequence.) There will be at most 100 positive numbers in the sequence.
You have to output the number which occurs the most number of times in the sequence. In case there are multiple numbers with the same number of occurrences, output the minimum such number.
11 3 1 2 4 -1
1
1 23 1 1 1 1 -1
1
65 99 33 22 22 99 -1
22
7 5 6 6 7 7 7 7 77 7 -1
7