Find elements with frequency two

code is correct but test cases are failing
link to my code

Hello @vdeepu028,

I have corrected your code:


Refer to the comments for better understanding.

Hope, this would help.
Give a like if you are satisfied.

Nope still first two cases are run error
and my format was same as compared to yours i cross checked

Hello @vdeepu028,

I shared the wrong code with you. :sweat_smile:

There were two mistakes in your code that I have corrected:

same output first two cases are run error ; my code was also showing this

Hello @vdeepu028,

Pardon me for not correcting the code at once.
But, i don’t have access to the IDE of this question.

I have made few more changes to your code:

Let me know if this doesn’t work either.

1 Like

Thanks bro it worked i have tried the same approach earlier but i printed 0 for no values you printed [] which is correct. Darn i was close but thanks for debugging.

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.