Skip to content

Latest commit

 

History

History
18 lines (16 loc) · 479 Bytes

File metadata and controls

18 lines (16 loc) · 479 Bytes

프로그래머스 Level1 : 푸드 파이트 대회

class Solution {
    public String solution(int[] food) {
        StringBuffer answer = new StringBuffer("0");
        for(int i=food.length-1; i>=0; i--){
            for(int j=0;j<food[i]/2; j++){
                answer.append(i);
                answer.insert(0,i);
            }
        }
        return answer.toString();
    }
}