728x90
https://school.programmers.co.kr/learn/courses/30/lessons/181902
📝 나의 풀이
using System;
public class Solution {
public int[] solution(string my_string) {
int[] answer = new int[52];
foreach (var c in my_string)
{
if('A'<=c && c<='Z')
{
answer[c - 'A']++;
}
else if ('a'<=c && c<='z')
{
answer[c - 'a' + 26]++;
}
}
return answer;
}
}
728x90
'코딩테스트 > [C#] 프로그래머스' 카테고리의 다른 글
[프로그래머스 | C# | Lv.0] 합성수 찾기 (0) | 2023.10.15 |
---|---|
[프로그래머스 | C# | Lv.1] 하샤드 수 (0) | 2023.10.13 |
[프로그래머스 | C# | Lv.0] 공배수 (0) | 2023.10.12 |
[프로그래머스 | C# | Lv.0] 문자열 정수의 합 (0) | 2023.10.11 |
[프로그래머스 | C# | Lv.1] 약수의 합 (1) | 2023.10.10 |