Skip to content

Commit d203d8e

Browse files
committed
1732_find-the-highest-altitude
1 parent ba138e5 commit d203d8e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Diff for: 1732_find-the-highest-altitude.py

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from typing import List
2+
3+
4+
class Solution:
5+
def largestAltitude(self, gain: List[int]) -> int:
6+
high_value = 0
7+
curr_val = 0
8+
for i in range(len(gain)):
9+
curr_val += gain[i]
10+
if curr_val > high_value:
11+
high_value = curr_val
12+
return high_value

0 commit comments

Comments
 (0)