TIL

1/19일자 TIL

오딘.L.스트레인지 2026. 1. 19. 20:18

오늘은 코드 카타를 1개 제출하였는데, 그 후엔 강의를 들은 것 밖에 없어서 코드 카타에서 배운 것만 올리기로 하였다.

핸드폰 번호 가리기

 

하고 나서 반복되는 .size()란 개념이 궁금해서 물어보았다.

#include <string>
#include <vector>

using namespace std;

string solution(string phone_number) 
{
    int n = phone_number.size();
    for (int i = 0; i < n-4; i++) {
        phone_number[i] = '*';
    }
    return phone_number;
}

'TIL' 카테고리의 다른 글

1/21일자 TIL  (1) 2026.01.21
1/20일자 TIL  (0) 2026.01.20
1/16일자 TIL  (0) 2026.01.16
1/15일자 TIL  (0) 2026.01.15
1/14일자 TIL  (0) 2026.01.14