C++||5 LINES|| EASIEST CODE || SIMPLE LOGIC||O(N)
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    int largestAltitude(vector<int>& gain) {\n// INITIALIZE VARI TO STORE SUM AND ANS\n        int ans = 0, sm = 0;\n//TRAVERSE GIVEN ARRAY\n        for(auto &x: gain){\n// ADD CURENT ELEMENT TO SUM\n            sm += x;\n//STORING MAX AMONG SUM IN ANS\n            ans = max(ans,sm);\n        }\n// RETURN ANS\n        return ans;\n    }\n};\n```
['Math', 'Prefix Sum', 'C++']