/**
 * The function copyIngredients takes two lists as arguments: chefIngredients and recipeIngredients.
 * It copies the items from chefIngredients list that are also present in recipeIngredients list.
 * The function returns the copied ingredients in a new list.
 *
 * @param chefIngredients The list of ingredients the chef has on hand.
 * @param recipeIngredients The list of ingredients required for a specific recipe.
 * @return A new list containing the ingredients that match between chefIngredients and recipeIngredients.
 */
fun copyIngredients(chefIngredients: List<String>, recipeIngredients: List<String>): List<String> {

    val copiedIngredients = mutableListOf<String>()
    for (chefIngredient in chefIngredients) {
        for (recipeIngredient in recipeIngredients) {
            if (chefIngredient == recipeIngredient) {
                copiedIngredients.add(chefIngredient)
                break  // Breaks out of the inner loop once a match is found to avoid duplicates
            }
        }
    }
    return copiedIngredients
}
/**
 * The function copyIngredients takes two lists as arguments: chefIngredients and recipeIngredients.
 * It copies the items from chefIngredients list that are also present in recipeIngredients list.
 * The function returns the copied ingredients in a new list.
 *
 * @param chefIngredients The list of ingredients the chef has on hand.
 * @param recipeIngredients The list of ingredients required for a specific recipe.
 * @return A new list containing the ingredients that match between chefIngredients and recipeIngredients.
 */
fun copyIngredients(chefIngredients: List<String>, recipeIngredients: List<String>): List<String> {
/**
 * The function copyIngredients takes two lists as arguments: chefIngredients and recipeIngredients.
 * It copies the items from chefIngredients list that are also present in recipeIngredients list.
 * The function returns the copied ingredients in a new list.
 *
 * @param chefIngredients The list of ingredients the chef has on hand.
 * @param recipeIngredients The list of ingredients required for a specific recipe.
 * @return A new list containing the ingredients that match between chefIngredients and recipeIngredients.
 */
fun copyIngredients(chefIngredients: List<String>, recipeIngredients: List<String>): List<String> {

    val copiedIngredients = mutableListOf<String>()
    for (chefIngredient in chefIngredients) {
        for (recipeIngredient in recipeIngredients) {
            if (chefIngredient == recipeIngredient) {
                copiedIngredients.add(chefIngredient)
                break  // Breaks out of the inner loop once a match is found to avoid duplicates
            }
        }
    }
    return copiedIngredients
}