์ฒด๊ฐ Level : โ
โโ Review: ํฐ๋ฆฐ๋๋กฌ ๋ฌธ์ ! |
๐ก์ ์ ๋ฐฐ์ด food๊ฐ ์ฃผ์ด์ก์ ๋, ๋ํ๋ฅผ ์ํ ์์์ ๋ฐฐ์น๋ฅผ ๋ํ๋ด๋ ๋ฌธ์์ด์ return
https://school.programmers.co.kr/learn/courses/30/lessons/134240#
class Solution {
public String solution(int[] food) {
String answer = "";
for (int j = 1; j<food.length; j++){
for (int i = 0; i < food[j]/2; i++){
answer += j;
}
}
answer += "0";
for (int j = food.length-1; j>0; j--){
for (int i = 0; i < food[j]/2; i++){
answer += j;
}
}
return answer;
}
}