Make Unreal REAL.
article thumbnail
Level 0. 문자 개수 세기

 

 

#include <iostream>
#include <vector>

using namespace std;

vector<int> solution(string my_string)
{
    vector<int> answer(52, 0);

    for (char c : my_string)
        ++answer[c - (isupper(c) ? 'A' : 'G')];

    return answer;
}
profile

Make Unreal REAL.

@diesuki4

포스팅이 좋았다면 "좋아요❤️" 또는 "구독👍🏻" 해주세요!

검색 태그