🔥100% Beats🔥||🔥C++🔥||🔥GET MAX PREFIX SUM🔥
Code\n\nclass Solution {\npublic:\n    int largestAltitude(vector<int>& gain) {\n        int ans = 0, s = 0;\n        for(auto &i: gain){\n            s += i;\n
# Code\n```\nclass Solution {\npublic:\n    int largestAltitude(vector<int>& gain) {\n        int ans = 0, s = 0;\n        for(auto &i: gain){\n            s += i;\n            ans = max(ans,s);\n        }\n        return ans;\n    }\n};\n```
['Array', 'Prefix Sum', 'C++']