/**
 * The chef is preparing a complex recipe. Help the chef complete the cooking instructions by
 * filling in the missing code.
 */
fun cookingInstructions(recipe: Map<String, Any>, pantry: MutableMap<String, Int>) {

    val ingredients = recipe["ingredients"] as Map<String, Int>
    val steps = recipe["steps"] as List<String>
    val desiredCookedLevel = recipe["desired_cooked_level"] as Int

    for ((ingredient, requiredQty) in ingredients) {
        // Check if the ingredient is available in the pantry
        if (pantry.containsKey(ingredient)) {
            val ingredientQty = pantry[ingredient]!!

            // Check if there is enough quantity of the ingredient available in the pantry
            if (ingredientQty >= requiredQty) {
                // Reduce the available quantity in the pantry
                pantry[ingredient] = pantry[ingredient]!! - requiredQty
                println("Added $requiredQty of $ingredient to the recipe.")
            } else {
                println("Insufficient quantity of $ingredient in the pantry.")
                return
            }
        } else {
            println("Missing $ingredient in the pantry.")
            return
        }
    }

    println("\nLet's start cooking!")

    steps.forEachIndexed { index, action ->
        val step = index + 1
        println("Step $step: $action")

        // Check if the cooking
    }
}
/**
 * The chef is preparing a complex recipe. Help the chef complete the cooking instructions by
 * filling in the missing code.
 */
fun cookingInstructions(recipe: Map<String, Any>, pantry: MutableMap<String, Int>) {
/**
 * The chef is preparing a complex recipe. Help the chef complete the cooking instructions by
 * filling in the missing code.
 */
fun cookingInstructions(recipe: Map<String, Any>, pantry: MutableMap<String, Int>) {

    val ingredients = recipe["ingredients"] as Map<String, Int>
    val steps = recipe["steps"] as List<String>
    val desiredCookedLevel = recipe["desired_cooked_level"] as Int

    for ((ingredient, requiredQty) in ingredients) {
        // Check if the ingredient is available in the pantry
        if (pantry.containsKey(ingredient)) {
            val ingredientQty = pantry[ingredient]!!

            // Check if there is enough quantity of the ingredient available in the pantry
            if (ingredientQty >= requiredQty) {
                // Reduce the available quantity in the pantry
                pantry[ingredient] = pantry[ingredient]!! - requiredQty
                println("Added $requiredQty of $ingredient to the recipe.")
            } else {
                println("Insufficient quantity of $ingredient in the pantry.")
                return
            }
        } else {
            println("Missing $ingredient in the pantry.")
            return
        }
    }

    println("\nLet's start cooking!")

    steps.forEachIndexed { index, action ->
        val step = index + 1
        println("Step $step: $action")

        // Check if the cooking
    }
}