/**
 * This exercise focuses on list comprehension and executing nested loops.
 * Given two lists, list_1 and list_2, your task is to find the common elements between them using list comprehension.
 */
fun intersectionOfLoops(list1: List<Any>, list2: List<Any>): List<Any> {

    val commonElements = mutableListOf<Any>()

    // Iterate through each element in list_1
    for (element1 in list1) {

        // Iterate through each element in list_2
        for (element2 in list2) {

            // Check if the elements are equal
            if (element1 == element2) {

                // Append the common element to the commonElements list
                commonElements.add(element1)
            }
        }
    }

    return commonElements
}
/**
 * This exercise focuses on list comprehension and executing nested loops.
 * Given two lists, list_1 and list_2, your task is to find the common elements between them using list comprehension.
 */
fun intersectionOfLoops(list1: List<Any>, list2: List<Any>): List<Any> {
/**
 * This exercise focuses on list comprehension and executing nested loops.
 * Given two lists, list_1 and list_2, your task is to find the common elements between them using list comprehension.
 */
fun intersectionOfLoops(list1: List<Any>, list2: List<Any>): List<Any> {

    val commonElements = mutableListOf<Any>()

    // Iterate through each element in list_1
    for (element1 in list1) {

        // Iterate through each element in list_2
        for (element2 in list2) {

            // Check if the elements are equal
            if (element1 == element2) {

                // Append the common element to the commonElements list
                commonElements.add(element1)
            }
        }
    }

    return commonElements
}