Need help for MAXCOUNT problem

I went through the editorial as well as other threads,my code satisfies all the test cases present in the problem page as well forum messages,hence this thread.
http://www.codechef.com/viewsolution/2934706

Hi,

Here is a test case on which your program fails:

1

2

24 16

Are you assuming that set creates an ordered collection? It doesn’t.

set([12,24,24,12,16,16]) gives you set([24, 16, 12]), and not set([12, 16, 24]).

A set is an unordered collection of unique elements. See here for more details.

2 Likes

For which test case is this simple code failing

Thank you.from next time onward,i`ll try harder to make my own test case :slight_smile:

1 Like

Got my mistake!!