/**
 * A chef wants to add a new ingredient to a recipe in his cookbook.
 * You need to write a function that takes the chef's cookbook, the ingredient to add, and the recipe to modify,
 * and adds the ingredient to the recipe in the cookbook. If the recipe does not exist, create it as a new entry.
 *
 * @param chef A dictionary representing the chef's cookbook.
 * @param ingredient The ingredient to be added to the recipe.
 * @param recipe The name of the recipe to modify/add.
 * @return Updated chef's cookbook after adding the ingredient to the specified recipe.
 */
fun addIngredient(chef: MutableMap<String, MutableList<String>>, ingredient: String, recipe: String): MutableMap<String, MutableList<String>> {

    // Check if the recipe already exists in the chef's cookbook
    if (recipe in chef) {
        // Add the ingredient to the recipe in the cookbook
        chef[recipe]?.add(ingredient)
    } else {
        // Create a new recipe and add the ingredient to it
        chef[recipe] = mutableListOf(ingredient)
    }
    
    // Return the updated chef's cookbook
    return chef
}
/**
 * A chef wants to add a new ingredient to a recipe in his cookbook.
 * You need to write a function that takes the chef's cookbook, the ingredient to add, and the recipe to modify,
 * and adds the ingredient to the recipe in the cookbook. If the recipe does not exist, create it as a new entry.
 *
 * @param chef A dictionary representing the chef's cookbook.
 * @param ingredient The ingredient to be added to the recipe.
 * @param recipe The name of the recipe to modify/add.
 * @return Updated chef's cookbook after adding the ingredient to the specified recipe.
 */
fun addIngredient(chef: MutableMap<String, MutableList<String>>, ingredient: String, recipe: String): MutableMap<String, MutableList<String>> {
/**
 * A chef wants to add a new ingredient to a recipe in his cookbook.
 * You need to write a function that takes the chef's cookbook, the ingredient to add, and the recipe to modify,
 * and adds the ingredient to the recipe in the cookbook. If the recipe does not exist, create it as a new entry.
 *
 * @param chef A dictionary representing the chef's cookbook.
 * @param ingredient The ingredient to be added to the recipe.
 * @param recipe The name of the recipe to modify/add.
 * @return Updated chef's cookbook after adding the ingredient to the specified recipe.
 */
fun addIngredient(chef: MutableMap<String, MutableList<String>>, ingredient: String, recipe: String): MutableMap<String, MutableList<String>> {

    // Check if the recipe already exists in the chef's cookbook
    if (recipe in chef) {
        // Add the ingredient to the recipe in the cookbook
        chef[recipe]?.add(ingredient)
    } else {
        // Create a new recipe and add the ingredient to it
        chef[recipe] = mutableListOf(ingredient)
    }
    
    // Return the updated chef's cookbook
    return chef
}