leetcodeSolution to some Leetcode problems written in C++ |
git clone git://git.dimitrijedobrota.com/leetcode.git |
Log | Files | Refs | README | LICENSE | |
2358.cpp (203B)
1 class Solution { 2 public: 3 int maximumGroups(const vector<int> &grades) { 4 int k = 0, total = 0; 5 while (total + k < grades.size()) 6 total += ++k; 7 return k; 8 } 9 };