Easy C++ with comments || Linear Equations
Jumbo Burgers: 4 Tomatoes + 1 CheeseSlice\nSmall Burgers: 2 Tomatoes + 1 CheeseSlice\n\nb = Jumbo Burgers, s = Small burgers\n\nThe two equations are\n4b + 2s =
Jumbo Burgers: 4 Tomatoes + 1 CheeseSlice\nSmall Burgers: 2 Tomatoes + 1 CheeseSlice\n\nb = Jumbo Burgers, s = Small burgers\n\nThe two equations are\n4*b + 2*s = Total no. of TomatoSlices\nb + s = Total no. of CheeseSlices\n\n**if no. TomatoSlices is odd then no solution possible**\n\nsolving them we get-\n\n**Jumbo Burgers = TomatoSlices/2 - cheeseSlices\nSmall Burgers = 2*CheeseSlices - TomatoSlices/2**\n\n```\nvector<int> numOfBurgers(int tomatoSlices, int cheeseSlices) {\n        if(tomatoSlices%2 != 0) // base case\n            return {};\n        \n        tomatoSlices /=2;\n        int b=tomatoSlices - cheeseSlices, s= 2*cheeseSlices - tomatoSlices;\n        \n        if(b < 0 || s < 0) // if b or s comes out to be negative\n            return {};\n        \n        return {b, s};\n    }\n
[]