calculating occurances of values in an input stream : I am a college student who is currently learning programming. one of the problem statements given to us was:
user inputs an integer n followed by n different integers. Without using arrays or strings, find the number which occurs the most number of times in the input stream.
we are required to use the simplecpp package which is basically easier commands than standard c++. for example we write repeat(n) to get a for loop with n iterations.
What can i do to solve the problem?.
I thought of creating a number like 10101010[number]10101010[number2]... to store the input and then splitting but this fails to solve the problem.
we are not allowed to use anything like while loops or string manipulation to solve the problem.the only solutions i could think of were using the string method and then manipulating the string but apparently that is not allowed.
Any method to do this and such other problems where input cannot be stored in an array?