Linear Algebra Solution with Explanation
This solution is not accepted by leetcode, but nonetheless I thought I would share. We can think of this problem as \'Some amount of Jumbo Burgers + some amount
This solution is not accepted by leetcode, but nonetheless I thought I would share. We can think of this problem as \'Some amount of Jumbo Burgers + some amount of Small Burgers better = the amount of tomato and cheese slices I have. Let `J = Jumbor Burger`, let `S = Small Burger`, let `t = tomato slices I have`, let `c = cheese slices I have`. \nThen,  `4*J + S*2 = t`,` J + S = c`. The first equation in words says, \'For 1 Jumber Burger I need 4 slices of tomatoes and for 1 Small burger I need 2 slices of tomatoes. Now, I don\'t know how many Jumbo Burgers and Small burgers I am going to make, but how ever many I end up making I better use all the tomatoe slices.\' Similarly, the second equation in words says, \'For 1 Jumber Burger I need 1 slice of cheese and for 1 Small burger I need 1 slice of cheese. Now, I don\'t know how many Jumbo Burgers and Small burgers I am going to make, but how ever many I end up making I better use all the cheese slices.\' Now we have a linear system of equations and we have tools to solve this problem. \n\n```\nimport numpy as np\nclass Solution:\n    def numOfBurgers(self, tomatoSlices: int, cheeseSlices: int) -> List[int]:\n        # Linear Algebra solution\n        a = np.array([[4, 2], [1, 1]])\n        b = np.array([tomatoSlices, cheeseSlices])\n        x = np.linalg.solve(a, b)\n        return x\n```
['Python']