알파벳 개수


Define input, output

  • Input: 소문자로 이루어진 단어 S
  • Output: 각 소문자별 count

설명

source code

1
2
3
4
5
6
7
8
import sys
from collections import Counter


S = sys.stdin.readline()
S = Counter(S)
answer = [str(S.get(chr(c), 0)) for c in range(ord("a"), ord("z") + 1)]
print(" ".join(answer))
Built with Hugo
Theme Stack designed by Jimmy