Agorithm/백준 알고리즘

백준 알고리즘 1159번 농구 경기(python)

kimjinho1 2021. 2. 17. 09:29
728x90
반응형

단순 문자열 문제이다. 

li = sorted([input()[0] for _ in range(int(input()))])
s = set(li)
res = []
for c in s:
    if li.count(c) >= 5:
        res.append(c)
print(''.join(sorted(res)) if len(res) > 0 else "PREDAJA")
728x90
반응형