diff --git a/code_study/Baekjoon/swift/10987.swift b/code_study/Baekjoon/swift/10987.swift new file mode 100644 index 0000000..873bf74 --- /dev/null +++ b/code_study/Baekjoon/swift/10987.swift @@ -0,0 +1,12 @@ +let letters = readLine()! +let count = letters.reduce(into: [:]){ counts, letter in counts[letter, default: 0] += 1 } + +let s = "aeiou" +var ans = 0 +for c in s { + if let n = count[c] { + ans += n + } +} + +print(ans) \ No newline at end of file