TIL

2/13일자 TIL

오딘.L.스트레인지 2026. 2. 13. 20:24

코드카타-푸드파이트 대회

#include <string>
#include <vector>
#include <algorithm>

using namespace std;

string solution(vector<int> food) 
{
    string left = "";

    for (int i = 1; i < (int)food.size(); i++) 
    {
        int repeat = food[i] / 2;

        for (int j = 0; j < repeat; j++) 
        {
            left += '0' + i;
        }
    }

    string right = left;
    reverse(right.begin(), right.end());

    string answer = left + "0" + right;
    return answer;
}

 

오늘은 시간을 너무 많이 허비했다. 그래도 수업 복습 연동을 따라간 만큼 팀 프로젝트를 엉망이더라도 해야 한다.

'TIL' 카테고리의 다른 글

2/20일자 TIL  (0) 2026.02.20
2/19일자 TIL  (0) 2026.02.19
2/12일자 TIL  (0) 2026.02.12
2/11일자 TIL  (0) 2026.02.11
2/10일자 TIL  (0) 2026.02.10