function solution(my_string) {
const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
const answer = Array(52).fill(0);
for (const char of my_string) {
const index = alphabet.indexOf(char);
answer[index]++;
}
return answer;
}
'Daily Logs > Algorithm Practice' 카테고리의 다른 글
[level 0] 카운트 다운 (0) | 2025.06.20 |
---|---|
[level 0] 글자 지우기 (0) | 2025.06.19 |
[Lv 0 QR code] (0) | 2025.06.13 |
[level 0] 접두사인지 확인하기 (1) | 2025.06.12 |
[level 0] 접미사인지 확인하기 (1) | 2025.06.11 |