for i in set(list): n = n if n>list.count(i) else list.count(n)
RIcter
2013-12-27 10:38:32 +08:00
...缩进呢,前面应该还有个n=0..
forestkeeper
2013-12-27 10:52:33 +08:00
int count = 0; int num = 0; for (int i = 0; i<n; ++i) if (count == 0) num = a[i], count = 1; else if (num == a[i]) ++count; else --count; return [count,num]