mirror of
https://github.com/codeflash-ai/codeflash-internal.git
synced 2026-05-04 18:25:18 +00:00
18 lines
301 B
Python
18 lines
301 B
Python
def problem_p03524(input_data):
|
|
from collections import Counter
|
|
|
|
def check(a, b):
|
|
|
|
return abs(a - b) <= 1
|
|
|
|
C = Counter(eval(input_data))
|
|
|
|
a, b, c = (C[s] for s in "abc")
|
|
|
|
if check(a, b) and check(b, c) and check(c, a):
|
|
|
|
return "YES"
|
|
|
|
else:
|
|
|
|
return "NO"
|