JAVA_LeetCode 2335_Minimum Amount of Time to Fill Cups 풀이 class Solution { public int fillCups(int[] amount) { // 배열의 가장 작은 수를 제외한 두 수가 0보다 작거나 같은경우 카운팅된 수를 반환한다. int cnt = 0; while(true){ Arrays.sort(amount); if(amount[2] <= 0 && amount[1] <= 0) break; amount[2]--; amount[1]--; cnt++; } return cnt; } } * 출처 https://leetcode.com/problems/minimum-amount-of-time-to-fill-cups...
JAVA_LeetCode 2335_Minimum Amount of Time to Fill Cups에 대한 요약내용입니다.
자세한 내용은 아래에 원문링크를 확인해주시기 바랍니다.