더 쉽게하는 방법이 있을꺼 같다..
N = input()
arr = [0] * 10
ans = 0
t1, t2 = divmod(N.count('6') + N.count('9'), 2)
N =N.replace('6', '')
N =N.replace('9', '')
ans = t1 + t2
for i in range(len(N)):
arr[int(N[i])] += 1
if ans > max(arr):
print(ans)
else:
print(max(arr))
'Algorithm > Implementaion' 카테고리의 다른 글
[백준] 2476번 주사위 게임 (0) | 2020.10.20 |
---|---|
[백준] 4101번 크냐? (0) | 2020.10.20 |
[백준] 2525번 오븐 시계 (0) | 2020.10.20 |
[백준] 2490번 윷놀이 (0) | 2020.10.20 |
[백준] 10773번 제로 (0) | 2020.10.16 |
댓글