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(c >= 'A' && c <= 'Z')
{
answer[c - 'A']++;
}
else if (c >= 'a' && c <= 'z')
{
answer[c - 'a' + 26]++;
}
}
return answer;
}
}
728x90
'코딩공부 > 프로그래머스' 카테고리의 다른 글
[프로그래머스]Lv.0 글자 지우기 C# (linq 포함) (0) | 2023.06.07 |
---|---|
[프로그래머스]Lv.0 배열 만들기 1 C# (for 곱셈 linq 포함) (0) | 2023.06.07 |
[프로그래머스]Lv.0 qr code C# (0) | 2023.06.07 |
[프로그래머스]Lv.0 세로 읽기 C# (0) | 2023.06.07 |
[프로그래머스]Lv.0 문자열의 뒤의 n글자 C# (0) | 2023.06.07 |