Company: American_Express
Difficulty: medium
Minimize Pizza Order Cost Problem Description You are ordering pizza for a party. You are given an order (a list of items to buy) and a pizzeria menu (a list of all available items and their prices). The pizzeria offers the following discounts: Discount 1: "Buy 3, the cheapest one is free!" Discount 2: "Buy 5 for 100!" Discount 3: "For every Large pizza, get a free Small one!" Discount 4: "Buy 3 Large, pay for 3 Medium!" Your goal is to minimize the total cost of the order by using at most one of the discounts the pizzeria offers. Precise descriptions of how every discount works can be found in the Examples section. Specification: Assume that the following declarations are given: class Pizza { public String name; public int price_S; public int price_M; public int price_L; } class OrderItem { public String name; public String size; public int quantity; } The menu is constructed as an array of Pizza objects, where: name denotes the name of the pizza: every name appears in the menu array