capacity to ship packages within d days

알고리즘/코딩테스트

[LeetCode] - 1011_Capacity to ship packages within d days

문제 소개Medium / Binary Searchhttps://leetcode.com/problems/capacity-to-ship-packages-within-d-days/description/풀이public int shipWithinDays(int[] weights, int days) { int answer = 0; int left = 0, right = 0; for (int tmp : weights) { left = Math.max(left, tmp); right += tmp; } while (left mid) { day++; result = 0; } r..

ppusda
'capacity to ship packages within d days' 태그의 글 목록