[level 0] 문자 개수 세기

2025. 6. 14. 16:04·Daily Logs/Algorithm Practice

 

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
'Daily Logs/Algorithm Practice' 카테고리의 다른 글
  • [level 0] 카운트 다운
  • [level 0] 글자 지우기
  • [Lv 0 QR code]
  • [level 0] 접두사인지 확인하기
Jcob.moon
Jcob.moon
반가워요~ 하루하루 꾸준히 코딩 작성하는 곳입니다 !!
  • Jcob.moon
    Pixelated Thoughts
    Jcob.moon
  • 전체
    오늘
    어제
    • HelloWorld (173) N
      • Daily Logs (122)
        • TIL (Today I Learned) (63)
        • Algorithm Practice (55)
        • Dev Book Notes (4)
      • Deep Dives (36) N
        • 문제 해결 (Troubleshooting) (3) N
        • CS Fundamentals (22) N
        • Career Prep (4)
        • Technical Notes (7)
      • Project Log (7)
      • Any (3)
      • Cooperation (4) N
        • Github (2) N
        • Conventions (1)
        • Git (1)
  • 블로그 메뉴

    • 홈
    • 태그
    • 방명록
  • 최근 댓글

  • hELLO· Designed By정상우.v4.10.3
Jcob.moon
[level 0] 문자 개수 세기
상단으로

티스토리툴바