Skip to content

Commit 4024045

Browse files
Merge pull request #2059 from CodingTestStudy2/최원준
[최원준] Day20
2 parents 4fe4991 + 1a16e0f commit 4024045

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
class Solution:
2+
def minimumEffort(self, tasks: list[list[int]]) -> int:
3+
tasks.sort(key=lambda x: x[1] - x[0], reverse=True)
4+
5+
ans = 0
6+
curr = 0
7+
8+
for actual, minimum in tasks:
9+
ans = max(ans, curr + minimum)
10+
curr += actual
11+
12+
return ans

0 commit comments

Comments
 (0)