leetcode

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

1860.cpp (352B)


0 class Solution { 1 public: 2 vector<int> memLeak(int memory1, int memory2) { 3 int time = 1; 4 while (time <= memory1 || time <= memory2) { 5 if (memory1 < memory2) 6 memory2 -= time; 7 else 8 memory1 -= time; 9 time++; 10 } 11 return {time, memory1, memory2}; 12 } 13 };