FindMajorityElements Accpeted on Leetcode but not in CB

Hi,
I have submitted “FindMajorityElements” solution on coding block TestCase5 is getting failed. But the same code has been accepted on Leetcode.
Can anyone help with the same?

thanks

hello @mohanman2210

pls save ur code here ->https://ide.codingblocks.com/
and share the link with me .
i will check

Here is the link

@mohanman2210
u havent saved the code.
paste ur code in the editor.

go to file option (present on top)
clikc on it. save option will appear.click on it.
a link will appear in ur search bar.
share that link

Can you check now?

yeah. . . . … . . . . .

there can be a case when only one majority element exist.
so handle that case.

Handled that case still not working

share ur updaated code

remove that if N< 3 condition andd then try

Removed, but still same test case 5 getting fail :frowning:

it is working.

image

But i am still getting this error

pls submit it here->
https://hack.codingblocks.com/app/contests/1290/1509/problem

I have refreshed the browser with ctrl+ f5 and submit it again and it got submitted. Surprised !!!

Thanks, @aman212yadav for you prompt responses. Appreciated (y)

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.