Easiest Approach || beats 100% || STL
Complexity\n- Time complexity:\n Add your time complexity here, e.g. O(n) \n    O(n)\n\n- Space complexity:\n Add your space complexity here, e.g. O(n) \n    O(
# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n    O(n)\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n    O(n)\n\n# Code\n```\nclass Solution {\npublic:\n    int largestAltitude(vector<int>& gain) {\n       vector<int>temp = {0};\n       for(auto it:gain){\n           temp.push_back(it + temp.back());\n       } \n       return *max_element(temp.begin(), temp.end());\n    }\n};\n```
['C++']