PAST4F
PAST4F
AMBIGUOUS if the number of occurrences is the same compared to above or below.
code:python
def solve(N, K, SS):
from collections import Counter
c = Counter(SS).most_common()
K -= 1
if K > 0:
if pv == ckv:
return "AMBIGUOUS"
if K < len(c) - 1:
if pv == ckv:
return "AMBIGUOUS"
return ck
---
This page is auto-translated from /nishio/PAST4F. If you looks something interesting but the auto-translated English is not good enough to understand it, feel free to let me know at @nishio_en. I'm very happy to spread my thought to non-Japanese readers.