🚀 Prefix Sum 🚀 Loop🚀 Easy Code 🚀 Python3 🚀
Please Upvote if you find this useful \uD83D\uDE0A\n\n# Complexity\n- Time complexity: O(n)\n Add your time complexity here, e.g. O(n) \n\n- Space complexity: O
## Please Upvote if you find this useful \uD83D\uDE0A\n\n# Complexity\n- Time complexity: $$O(n)$$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: $$O(1)$$\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution:\n    def largestAltitude(self, gain: List[int]) -> int:\n        sol = 0\n        curHeight = 0\n\n        for Height in gain:\n            curHeight += Height\n            sol = max(sol, curHeight)\n        \n        return sol\n```\n\n## Please Upvote if you find this useful \uD83D\uDE0A\n
['Array', 'Prefix Sum', 'Python', 'Python3']