leetcodeSolution to some Leetcode problems written in C++ |
git clone git://git.dimitrijedobrota.com/leetcode.git |
Log | Files | Refs | README | LICENSE |
3192.cpp (239B)
0 class Solution { 1 public: 2 int minOperations(const vector<int> &nums) const { 3 int res = 0; 4 5 for (const int n : nums) { 6 if ((n + res) % 2) continue; 7 res++; 8 } 9 10 return res; 11 } 12 };