/**
 * This exercise requires the chef to find the ingredients in common
 * between two lists and print them in ascending order using a looping statement.
 */
fun intersectionLessThanLoop(chefIngredients: List<String>, dishIngredients: List<String>) {

    // Create an empty list to store the common ingredients
    val commonIngredients = mutableListOf<String>()

    // Loop through each ingredient in the chef's list
    for (ingredient in chefIngredients) {
        // Check if the ingredient is also present in the dish's list
        if (ingredient in dishIngredients) {
            // Add the ingredient to the common ingredients list
            commonIngredients.add(ingredient)
        }
    }

    // Sort the common ingredients in ascending order
    commonIngredients.sort()

    // Print the common ingredients
    for (ingredient in commonIngredients) {
        println(ingredient)
    }
}
/**
 * This exercise requires the chef to find the ingredients in common
 * between two lists and print them in ascending order using a looping statement.
 */
fun intersectionLessThanLoop(chefIngredients: List<String>, dishIngredients: List<String>) {
/**
 * This exercise requires the chef to find the ingredients in common
 * between two lists and print them in ascending order using a looping statement.
 */
fun intersectionLessThanLoop(chefIngredients: List<String>, dishIngredients: List<String>) {

    // Create an empty list to store the common ingredients
    val commonIngredients = mutableListOf<String>()

    // Loop through each ingredient in the chef's list
    for (ingredient in chefIngredients) {
        // Check if the ingredient is also present in the dish's list
        if (ingredient in dishIngredients) {
            // Add the ingredient to the common ingredients list
            commonIngredients.add(ingredient)
        }
    }

    // Sort the common ingredients in ascending order
    commonIngredients.sort()

    // Print the common ingredients
    for (ingredient in commonIngredients) {
        println(ingredient)
    }
}