Skip to content

Commit 3aab67b

Browse files
committed
📝 [ LeetCode ] Python Medium : 2214. Minimum Health to Beat Game
1 parent 67f893f commit 3aab67b

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

LeetCode/Python/2_Medium/2214.py

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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+

README.md

+6
Original file line numberDiff line numberDiff line change
@@ -2475,6 +2475,12 @@
24752475
<td> <a href=""> </a></td>
24762476
<td> 2023. 01. 08 </td>
24772477
</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>
24782484
</table>
24792485

24802486
</details>

0 commit comments

Comments
 (0)