You're managing a burger restaurant and need to determine the exact combination of burgers to make with your available ingredients to avoid any waste.
Your restaurant serves two types of burgers:
- Jumbo Burger: Requires
4 tomato slicesand1 cheese slice - Small Burger: Requires
2 tomato slicesand1 cheese slice
Given tomatoSlices and cheeseSlices available in your kitchen, you need to find how many of each burger type to make such that:
- All tomato slices are used (no waste)
- All cheese slices are used (no waste)
Goal: Return [total_jumbo, total_small] representing the number of Jumbo and Small burgers respectively. If it's impossible to use all ingredients exactly, return an empty array [].
Example: With 16 tomato slices and 7 cheese slices, you can make 1 Jumbo burger (uses 4 tomatoes, 1 cheese) and 6 Small burgers (uses 12 tomatoes, 6 cheese), using all ingredients perfectly.
Input & Output
Constraints
- 0 โค tomatoSlices, cheeseSlices โค 107
- Time limit: 1 second per test case
- Both inputs are non-negative integers