/**
 * In this exercise, you are a chef preparing a dish. Complete the code below to iterate through the ingredients,
 * and for each ingredient, check if it is available in the pantry. If the ingredient is available, add it to a list
 * called 'availableIngredients'. If the ingredient is not available, print a message stating that the ingredient is
 * missing and break the iteration. Finally, if all the ingredients are available, print a success message in the else
 * block.
 */
fun cookDish(dishName: String, ingredients: List<String>) {

    val availableIngredients = mutableListOf<String>()
    val pantry = listOf("salt", "pepper", "olive oil", "tomatoes", "onions")

    for (ingredient in ingredients) {
        if (ingredient in pantry) {
            availableIngredients.add(ingredient)
        } else {
            println("Ingredient $ingredient is missing.")
            break
        }
    }

    if (availableIngredients.size == ingredients.size) {
        println("All ingredients are available. You can cook $dishName.")
    }
}
/**
 * In this exercise, you are a chef preparing a dish. Complete the code below to iterate through the ingredients,
 * and for each ingredient, check if it is available in the pantry. If the ingredient is available, add it to a list
 * called 'availableIngredients'. If the ingredient is not available, print a message stating that the ingredient is
 * missing and break the iteration. Finally, if all the ingredients are available, print a success message in the else
 * block.
 */
fun cookDish(dishName: String, ingredients: List<String>) {
/**
 * In this exercise, you are a chef preparing a dish. Complete the code below to iterate through the ingredients,
 * and for each ingredient, check if it is available in the pantry. If the ingredient is available, add it to a list
 * called 'availableIngredients'. If the ingredient is not available, print a message stating that the ingredient is
 * missing and break the iteration. Finally, if all the ingredients are available, print a success message in the else
 * block.
 */
fun cookDish(dishName: String, ingredients: List<String>) {

    val availableIngredients = mutableListOf<String>()
    val pantry = listOf("salt", "pepper", "olive oil", "tomatoes", "onions")

    for (ingredient in ingredients) {
        if (ingredient in pantry) {
            availableIngredients.add(ingredient)
        } else {
            println("Ingredient $ingredient is missing.")
            break
        }
    }

    if (availableIngredients.size == ingredients.size) {
        println("All ingredients are available. You can cook $dishName.")
    }
}