I am not able to understand the problem statement
Didnt get the queestion
You have to print the frequent numbers in the stream
Input:
1
5 2
5 1 3 5 2
5 comes : print( { 5 } )
1 comes : print( { 1,5 } )
3 comes : print( { 1,3 } ) , all three have same frequency so taking smaller 2.
5 comes : print( { 5,1 } ) , now 5 has max frequency.
2 comes : print( { 5,1 } )
Final output : 5, 1 5, 1 3, 5 1, 5 1.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.