array 썸네일형 리스트형 프로그래머스_Level1_과일장수 풀이 import java.util.*; class Solution { public int solution(int k, int m, int[] score) { int answer = 0; int boxSize = score.length/m; int startCount=score.length-1; Arrays.sort(score); for(int i=0; i0){ answer+=score[startCount-m+1]*m; } startCount=startCount-m; } return answer; } } 생각을 해보자. 사실 맨 처음에는 리스트를 사용해서 데이터들을 분류한뒤 분류된 데이터들에서 최소값들을 Math.min과 같은 내장함수를 이용하여 끄집어 낼 생각을 했지만 굳이 그렇게 하지않고도 Array.. 더보기 이전 1 다음