leetcode

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

3218.cpp (379B)


0 class Solution { 1 public: 2 int minimumCost(int n, int m, const vector<int> &hCut, const vector<int> &vCut) const { 3 int res = accumulate(begin(hCut), end(hCut), 0) + accumulate(begin(vCut), end(vCut), 0); 4 5 for (const int a : hCut) { 6 for (const int b : vCut) { 7 res += min(a, b); 8 } 9 } 10 11 return res; 12 } 13 };