You are viewing a single comment's thread. Return to all comments →
from collections import *
def birthdayCakeCandles(n, ar):
res = Counter(ar)
Exactly like I did! Nice!
This is not a correct solution but I do not know why it is passing. You should:
In some test cases, the highest (max) element is the one most common - like in example case, where 3 is the most common element. It also passes some test cases.
The correct solution is the one with Counter.