We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a600ced commit b12fe77Copy full SHA for b12fe77
1 file changed
live8/test86/문제2/황장현.js
@@ -16,7 +16,13 @@ function solution(input) {
16
while (low <= high) {
17
const mid = Math.floor((low + high) / 2);
18
const sum = 지방예산요청.reduce((acc, v) => acc + (v <= mid ? v : mid), 0);
19
+ if (sum > M) {
20
+ high = mid - 1;
21
+ } else {
22
+ low = mid + 1;
23
+ }
24
}
25
+ return high;
26
27
28
console.log(solution(input));
0 commit comments