File tree 2 files changed +16
-0
lines changed
2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change
1
+ # [ LeetCode ] 2214. Minimum Health to Beat Game
2
+
3
+ def solution (damage : list [int ], armor : int ) -> int :
4
+ answer : int = 1
5
+ max_damage : int = 0
6
+ for current in damage :
7
+ answer += current
8
+ max_damage = max (max_damage , current )
9
+ return answer - min (max_damage , armor )
10
+
Original file line number Diff line number Diff line change 2475
2475
<td> <a href=""> </a></td>
2476
2476
<td> 2023. 01. 08 </td>
2477
2477
</tr >
2478
+ <tr align =" left " >
2479
+ <td> <a href="https://leetcode.com/problems/minimum-health-to-beat-game/description/"> 2214. Minimum Health to Beat Game </a></td>
2480
+ <td> <a href="./LeetCode/Python/2_Medium/2214.py"> 2214.py </a></td>
2481
+ <td> <a href=""> </a></td>
2482
+ <td> 2023. 01. 09 </td>
2483
+ </tr >
2478
2484
</table >
2479
2485
2480
2486
</details >
You can’t perform that action at this time.
0 commit comments