Please check my solution and spot what i did wrong.
https://www.codechef.com/viewsolution/34825450
Any help would be highly appreciated
You were not doing frequency part properly(i would say a bit complex)
I edited your code(Just edited your countFreq Function)
Your AC code-Click Here
There were two conditions to check
1)If frequency of max element >1 then Answer is NO
2)If frequency of element other than max element >2 then Answer is NO
And Friend one piece of advice i wanna share with you that try to avoid making functions and write it in main() function if its possible.
Hereβs video solution of this great problem, the same way explained above : June Lunchtime 2020 Division 2 Problem-B codechef. - YouTube
Hi, thank you so much for clearing the issue. I can now understand why test cases would fail! Thanks for the advice too. Iβm starting with CP, and it would definitely help me to solve further contests/problems.
Great explaination
Yeah Friend,
All the best for ahead