/**
 * A Chef is making a shopping list for the ingredients needed to prepare a dish. Given a list of items and a budget, this function should return the items that can be purchased within the budget.
 *
 * @param items A list of maps, where each map represents an item in the store and contains 'name' and 'price' keys.
 * @param budget The maximum amount of money the Chef can spend on groceries.
 * @return A list of items that can be purchased within the given budget.
 */
fun makeShoppingList(items: List<Map<String, Any>>, budget: Double): List<String> {

    val purchasedItems = mutableListOf<String>()

    for (item in items) {
        if (item["price"] as Double <= budget) {
            purchasedItems.add(item["name"] as String)
        }
    }

    return purchasedItems
}

// Use the makeShoppingList function to create a list of groceries within the budget
/**
 * A Chef is making a shopping list for the ingredients needed to prepare a dish. Given a list of items and a budget, this function should return the items that can be purchased within the budget.
 *
 * @param items A list of maps, where each map represents an item in the store and contains 'name' and 'price' keys.
 * @param budget The maximum amount of money the Chef can spend on groceries.
 * @return A list of items that can be purchased within the given budget.
 */
fun makeShoppingList(items: List<Map<String, Any>>, budget: Double): List<String> {
/**
 * A Chef is making a shopping list for the ingredients needed to prepare a dish. Given a list of items and a budget, this function should return the items that can be purchased within the budget.
 *
 * @param items A list of maps, where each map represents an item in the store and contains 'name' and 'price' keys.
 * @param budget The maximum amount of money the Chef can spend on groceries.
 * @return A list of items that can be purchased within the given budget.
 */
fun makeShoppingList(items: List<Map<String, Any>>, budget: Double): List<String> {

    val purchasedItems = mutableListOf<String>()

    for (item in items) {
        if (item["price"] as Double <= budget) {
            purchasedItems.add(item["name"] as String)
        }
    }

    return purchasedItems
}

// Use the makeShoppingList function to create a list of groceries within the budget