ā back to unit
Medium
# power tools medium
Only Allowed Toppings
The picky pizza oven has an allowed-toppings list, and it rejects any order containing something else. š
You get the allowed toppings and the customer's order. Print order accepted if every ordered topping is allowed, or not on the menu.
Example:
Input: allowed = ["cheese", "olive", "corn", "basil"], order = ["corn", "cheese"]
Output: order accepted
Every ordered topping ("corn", "cheese") is inside the allowed set, so the order set is a subset.
Input: allowed = ["cheese", "olive"], order = ["cheese", "pineapple"]
Output: not on the menu
"pineapple" isn't in the allowed set, so the order set isn't a subset.
š” need a hint?
pt-allowed-toppings.pyš given lines are locked ā write your code in between
loading...