From 1ba8b115a9374133421f738b906d0a4de78f808f Mon Sep 17 00:00:00 2001 From: songyc macbook Date: Sun, 1 Feb 2026 20:32:48 +0900 Subject: [PATCH] baekjoon 20260201 --- code_study/Baekjoon/swift/10987.swift | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 code_study/Baekjoon/swift/10987.swift 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