https://school.programmers.co.kr/learn/courses/30/lessons/134240
마 실화가
내가 이거 왜 못풀었는지 알아?
to_string()
이 기억 안나서
수민아!!!!!!!!!!!!!!!!!!!!!!!!!
제발!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
ㅠㅠ
#include <string>
#include <vector>
using namespace std;
string solution(vector<int> food) {
string answer = "";
answer += "0";
for (int i = food.size() - 1 ; i > 0 ; i--) {
if (food[i] < 2) continue;
for (int j = 0 ; j < food[i] / 2 ; j++) {
answer += to_string(i);
answer = to_string(i) + answer;
}
}
return answer;
}