Try his
Implement in Linked List, with each node containing a number and its frequency.
Whenever a number is input, it tries to find it if it's in the List.
If so, add its frequency by 1.
If not, add a tail containing the number into the Linked List and set its frequency to 1.
At the end, scan the whole List and try to find out the nodes containing max frequency.
Whenever a number is input, it tries to find it if it's in the List.
If so, add its frequency by 1.
If not, add a tail containing the number into the Linked List and set its frequency to 1.
At the end, scan the whole List and try to find out the nodes containing max frequency.
And you are here, now, always.
People are not memories that you can put into words. They live.