Leetcode 1401 Solution
This article provides solution to leetcode question 1401 (number-of-burgers-with-no-waste-of-ingredients)
Access this page by simply typing in "lcs 1401" in your browser address bar if you have bunnylol configured.
Leetcode Question Link
https://leetcode.com/problems/number-of-burgers-with-no-waste-of-ingredients
Solution
class Solution:
def numOfBurgers(self, tomatoSlices: int, cheeseSlices: int) -> List[int]:
if tomatoSlices % 2 == 1:
return []
x = tomatoSlices // 2 - cheeseSlices
y = cheeseSlices - x
if x < 0 or y < 0:
return []
return [x, y]