/**
 * Given two recipes, create a list with the common ingredients using the 'AND' operator.
 *
 * Example:
 * addIngredients(listOf("sugar", "flour", "eggs"), listOf("sugar", "butter", "milk")) -> ["sugar"]
 *
 * @param recipe1 The ingredients of the first recipe.
 * @param recipe2 The ingredients of the second recipe.
 * @return List containing the ingredients present in both recipes.
 */
fun addIngredients(recipe1: List<String>, recipe2: List<String>): List<String> {

    // Initialize an empty list to store the common ingredients
    val commonIngredients = mutableListOf<String>()
    
    // Loop through each ingredient in recipe1
    for (ingredient in recipe1) {
        // Check if the ingredient is also present in recipe2
        if (ingredient in recipe2) {
            // Append the ingredient to the commonIngredients list
            commonIngredients.add(ingredient)
        }
    }
    
    // Return the commonIngredients list
    return commonIngredients
}
/**
 * Given two recipes, create a list with the common ingredients using the 'AND' operator.
 *
 * Example:
 * addIngredients(listOf("sugar", "flour", "eggs"), listOf("sugar", "butter", "milk")) -> ["sugar"]
 *
 * @param recipe1 The ingredients of the first recipe.
 * @param recipe2 The ingredients of the second recipe.
 * @return List containing the ingredients present in both recipes.
 */
fun addIngredients(recipe1: List<String>, recipe2: List<String>): List<String> {
/**
 * Given two recipes, create a list with the common ingredients using the 'AND' operator.
 *
 * Example:
 * addIngredients(listOf("sugar", "flour", "eggs"), listOf("sugar", "butter", "milk")) -> ["sugar"]
 *
 * @param recipe1 The ingredients of the first recipe.
 * @param recipe2 The ingredients of the second recipe.
 * @return List containing the ingredients present in both recipes.
 */
fun addIngredients(recipe1: List<String>, recipe2: List<String>): List<String> {

    // Initialize an empty list to store the common ingredients
    val commonIngredients = mutableListOf<String>()
    
    // Loop through each ingredient in recipe1
    for (ingredient in recipe1) {
        // Check if the ingredient is also present in recipe2
        if (ingredient in recipe2) {
            // Append the ingredient to the commonIngredients list
            commonIngredients.add(ingredient)
        }
    }
    
    // Return the commonIngredients list
    return commonIngredients
}