Number of Burgers with No Waste of Ingredients
Medium · Math
Given two integers tomatoSlices and cheeseSlices. The ingredients of different burgers are as follows:
Return [total_jumbo, total_small] so that the number of remaining tomatoSlices equal to 0 and the number of remaining cheeseSlices equal to 0. If it is not possible to make the remaining tomatoSlices and cheeseSlices equal to 0 return [].
Example 1
Input: tomatoSlices = 16, cheeseSlices = 7 Output: [1,6]
Example 2
Input: tomatoSlices = 17, cheeseSlices = 4 Output: []
Example 3
Input: tomatoSlices = 4, cheeseSlices = 17 Output: []
Constraints
- 0 <= tomatoSlices, cheeseSlices <= 107
Starter code (python)
class Solution(object):
def numOfBurgers(self, tomatoSlices, cheeseSlices):
"""
:type tomatoSlices: int
:type cheeseSlices: int
:rtype: List[int]
"""
Related problems
- Add Two Numbers (Medium)
- Reverse Integer (Medium)
- Palindrome Number (Easy)
Previous: Find Winner on a Tic Tac Toe Game · Next: Palindrome Partitioning III · All problems
Zepruv is a technical interview practice platform. Read any problem for free; sign in to run your code, submit and keep your progress.