Easy C++ Solution
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        int sum=0;\n        int max_1=0;\n        vector<int> ans;\n        for(int i=0;i<gain.size();i++){\n            sum=sum+gain[i];\n            max_1=max(max_1,sum);\n        }\n        return max_1;\n\n        \n    }\n};\n```
['C++']