I asked four five time please correct my main function

Please correct my main function

hi @rssrivastavarohan, your code is not correct as you have to find all the majority elements occurring more than floor(N/3) times so we can have more than one numbers as answers , it appears that you are using moore voting algorithm for majority element which will fetch you single most occurring element.So what we can do is we first find two candidates. Then we check if any of these two candidates is occurs more than n/3 times.

refer code for more clearity :-

hi @rssrivastavarohan have you re-opened your doubt?

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.