[알고리즘/백준] 10808: 알파벳 개수(python)

유현민·2022년 4월 6일
0

알고리즘

목록 보기
101/253

여러가지 방법이 있지만 자료구조를 연습하기 위해서 counter를 쓰지않고 스택으로 풀었다.

a = list(input())
ans = [0] * 26

while a:
    ans[ord(a.pop()) - ord('a')] += 1

print(*ans)
profile
smilegate megaport infra

0개의 댓글