leetcode

Solution to some Leetcode problems written in C++
git clone git://git.dimitrijedobrota.com/leetcode.git
Log | Files | Refs | README | LICENSE

1732.cpp (208B)


      1 class Solution {
      2   public:
      3     int largestAltitude(const vector<int> &gain) {
      4         int maxi = 0, crnt = 0;
      5         for (int n : gain)
      6             maxi = max(maxi, crnt += n);
      7         return maxi;
      8     }
      9 };