C++: math solution
Solution:\nLet T = # of tomato slices, C = # of cheese slices, x = # of jumbo burgers, y = # of small burgers => x + y = C, 4x + 2y = T\nSolving the system of e
Solution:\nLet T = # of tomato slices, C = # of cheese slices, x = # of jumbo burgers, y = # of small burgers => x + y = C, 4x + 2y = T\nSolving the system of equations we get x = (T - 2C) / 2, y = C - (T - 2C) / 2 = (4C - T) / 2\n\n```\nclass Solution {\npublic:\n    /// 4 ms, faster than 68.27% of C++\n    /// 7.1 MB, less than 97.21% of C++\n    vector<int> numOfBurgers(int tomatoSlices, int cheeseSlices)\n    {\n        if (tomatoSlices % 2)\n            return vector<int>();\n        int jb = (tomatoSlices - 2*cheeseSlices) / 2;\n        int sb = cheeseSlices - jb;\n        if (jb < 0 || sb < 0)\n            return vector<int>();\n        return {jb,sb};\n    }\n};
[]