[C++] Easy solution explained with comments || TC O(1) OC O(1)
\nclass Solution {\npublic:\n    vector<int> numOfBurgers(int tomatoSlices, int cheeseSlices) {\n        vector<int> ans;\n        int a = tomatoSlices;\n      
```\nclass Solution {\npublic:\n    vector<int> numOfBurgers(int tomatoSlices, int cheeseSlices) {\n        vector<int> ans;\n        int a = tomatoSlices;\n        int b = cheeseSlices;\n        \n        // Let the number of Jumbo and Small Burger be x and y\n        double x,y;\n        \n        // Solve the simultaneous equation for x and y\n        x = (double)(a-2*b)/(double)2;\n        y = (double)(4*b-a)/(double)2;\n        \n        // Check if they can be actual values of number of burgers\n        if(x==(int)x && y==(int)y && x>=0 && y>=0){\n            ans.push_back(x);\n            ans.push_back(y);\n        }\n        \n        return ans;\n    }\n};\n```
['Math']