From b402cce21aad832c0a46fbc538888e085dbc9891 Mon Sep 17 00:00:00 2001 From: bumpsoo Date: Fri, 19 Jun 2026 07:25:28 +0000 Subject: [PATCH] https://leetcode.com/problems/find-the-highest-altitude --- easy/find_the_highest_altitude.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 easy/find_the_highest_altitude.py 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