Euron Problem DSA Doubt

https://www.codechef.com/viewsolution/34285989
Why am I getting WA? I have taken the presence of duplicates in input into account. Could someone please provide a test case which can help me rectify the bug in my code.

6
9 9 9 9 9 9
9
18 38 82 18 18 18 18 18 18
5
4 7 4 7 7
Your code fails to handle duplicate elements sometimes.

1 Like

@aayush_84719 Thank you. That helped a lot.