Easy to understand python solution
Approach\nTo solve this problem, we need to store the original element and move to the next element by adding the difference. Thus, cur_num stores the value fro
# Approach\nTo solve this problem, we need to store the original element and move to the next element by adding the difference. Thus, cur_num stores the value from the list with heights. At each iteration we look at the maximum value.\n\n# Complexity\n- Time complexity:\nThe complexity of this algorithm is O(n) and it is executed in 28 ms\n\n- Space complexity:\n16.10MB\n\n# Code\n```\nclass Solution:\n    def largestAltitude(self, gain: List[int]) -> int:\n        max_num = 0\n        cur_num = 0\n\n        for i in range(len(gain)):\n            if max_num < cur_num + gain[i]:\n                max_num = cur_num + gain[i]\n\n            cur_num += gain[i] \n        \n        return max_num\n    \n```
['Python3']