/**
 * This exercise is about nested loops and complement operators in the context of a chef cooking a dish.
 */
fun cookingInstructions(ingredients: List<String>, pantry: List<String>, alternatives: List<String>): String {

    val unavailableIngredients = mutableListOf<String>()

    for (ingredient in ingredients) {
        if (ingredient !in pantry) {
            unavailableIngredients.add(ingredient)
        }
    }

    for (unavailableIngredient in unavailableIngredients) {
        for (alternative in alternatives) {
            if (alternative in pantry) {
                return "You can replace $unavailableIngredient with $alternative and proceed with the recipe."
            }
        }
    }

    return "All the ingredients are available in the pantry. You can proceed with the recipe."
}
/**
 * This exercise is about nested loops and complement operators in the context of a chef cooking a dish.
 */
fun cookingInstructions(ingredients: List<String>, pantry: List<String>, alternatives: List<String>): String {
/**
 * This exercise is about nested loops and complement operators in the context of a chef cooking a dish.
 */
fun cookingInstructions(ingredients: List<String>, pantry: List<String>, alternatives: List<String>): String {

    val unavailableIngredients = mutableListOf<String>()

    for (ingredient in ingredients) {
        if (ingredient !in pantry) {
            unavailableIngredients.add(ingredient)
        }
    }

    for (unavailableIngredient in unavailableIngredients) {
        for (alternative in alternatives) {
            if (alternative in pantry) {
                return "You can replace $unavailableIngredient with $alternative and proceed with the recipe."
            }
        }
    }

    return "All the ingredients are available in the pantry. You can proceed with the recipe."
}