문제 링크 (opens new window)

# 풀이

unicodeScalar로 캐릭터 인덱싱

import Foundation

var input = readLine()!
var count: [Int] = .init(repeating: 0, count: 26)

for char in input {
    let index = Int(char.unicodeScalars.first!.value - "a".unicodeScalars.first!.value)
    count[index] += 1
}

for i in count {
    print(i, terminator: " ")
}