leetcodeSolution to some Leetcode problems written in C++ |
git clone git://git.dimitrijedobrota.com/leetcode.git |
Log | Files | Refs | README | LICENSE |
1276.cpp (362B)
0 class Solution { 1 public: 2 vector<int> numOfBurgers(const int tomatoSlices, int const cheeseSlices) const { 3 if (tomatoSlices % 2) return {}; 4 if (cheeseSlices * 4 < tomatoSlices) return {}; 5 if (cheeseSlices * 2 > tomatoSlices) return {}; 6 7 return {tomatoSlices / 2 - cheeseSlices, cheeseSlices * 2 - tomatoSlices / 2}; 8 } 9 };