Unable to solve test 0 and test 1

I have seen the subsequent video of Boyer-Moore majority vote algorithm, but i had my own approach for the question through unordered mapping and then printing out the keys. The test cases #0 and #1 won’t pass, I am trying to find the boundary cases but I am unable to find the issue is it the complexity?

hello @taneja7.manik
image
this elseif should not be there inside for loop.

put it outside the for loop. and print if count==0

I’ll try to work on the order then thank you