/**
 * This function takes a recipe as input and replaces a specific ingredient with a new one.
 *
 * @param recipe A list of ingredients in the recipe.
 * @param oldIngredient The ingredient to be replaced.
 * @param newIngredient The replacement ingredient.
 * @return The modified recipe with replaced ingredient.
 */
fun searchAndReplaceIngredients(recipe: MutableList<String>, oldIngredient: String, newIngredient: String): List<String> {

    for (i in recipe.indices) {
        if (recipe[i] == oldIngredient) {
            recipe[i] = newIngredient
        }
    }
    return recipe
}
/**
 * This function takes a recipe as input and replaces a specific ingredient with a new one.
 *
 * @param recipe A list of ingredients in the recipe.
 * @param oldIngredient The ingredient to be replaced.
 * @param newIngredient The replacement ingredient.
 * @return The modified recipe with replaced ingredient.
 */
fun searchAndReplaceIngredients(recipe: MutableList<String>, oldIngredient: String, newIngredient: String): List<String> {
/**
 * This function takes a recipe as input and replaces a specific ingredient with a new one.
 *
 * @param recipe A list of ingredients in the recipe.
 * @param oldIngredient The ingredient to be replaced.
 * @param newIngredient The replacement ingredient.
 * @return The modified recipe with replaced ingredient.
 */
fun searchAndReplaceIngredients(recipe: MutableList<String>, oldIngredient: String, newIngredient: String): List<String> {

    for (i in recipe.indices) {
        if (recipe[i] == oldIngredient) {
            recipe[i] = newIngredient
        }
    }
    return recipe
}