1276.cpp (362B)
1 class Solution { 2 public: 3 vector<int> numOfBurgers(const int tomatoSlices, int const cheeseSlices) const { 4 if (tomatoSlices % 2) return {}; 5 if (cheeseSlices * 4 < tomatoSlices) return {}; 6 if (cheeseSlices * 2 > tomatoSlices) return {}; 7 8 return {tomatoSlices / 2 - cheeseSlices, cheeseSlices * 2 - tomatoSlices / 2}; 9 } 10 };