diff --git a/easy/find_the_highest_altitude.py b/easy/find_the_highest_altitude.py new file mode 100644 index 0000000..219a3f1 --- /dev/null +++ b/easy/find_the_highest_altitude.py @@ -0,0 +1,12 @@ +# https://leetcode.com/problems/find-the-highest-altitude + +from typing import List + +class Solution: + def largestAltitude(self, gain: List[int]) -> int: + result = 0 + current = 0 + for altitude in gain: + current += altitude + result = max(current, result) + return result \ No newline at end of file