Testcase 2 shows wrong answer

output for given test case is correct . i am not able to understand where am i wrong . could you please help?

Hi @vijit.chandhok99, please save your code on ide.codingblocks.com an share the URL here.

Hi @vijit.chandhok99, one testcase is giving wrong answer. If you notice, your program alters the value of p.first i.e. the value that will be appearing most of the times will be stored here, will be altered only if the if condition inside the for loop gets true. What if p.first is never assigned a value. Then also p.first is commanded to be printed, and there it will give some irrelevant answer.
Sorry for late reply. Hope this helps :slight_smile:

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.