/**
 * This function takes two lists and finds the intersection, i.e., the common elements, between them.
 * It combines a for loop with the intersection function.
 */
fun intersectLists(list1: List<Any>, list2: List<Any>): List<Any> {

    // Create an empty list to store the intersection
    val intersection = mutableListOf<Any>()

    // Iterate through each element in the first list
    for (item1 in list1) {
        // Check if the element is present in the second list
        if (item1 in list2) {
            intersection.add(item1)
        }
    }

    // Return the intersection
    return intersection
}
/**
 * This function takes two lists and finds the intersection, i.e., the common elements, between them.
 * It combines a for loop with the intersection function.
 */
fun intersectLists(list1: List<Any>, list2: List<Any>): List<Any> {
/**
 * This function takes two lists and finds the intersection, i.e., the common elements, between them.
 * It combines a for loop with the intersection function.
 */
fun intersectLists(list1: List<Any>, list2: List<Any>): List<Any> {

    // Create an empty list to store the intersection
    val intersection = mutableListOf<Any>()

    // Iterate through each element in the first list
    for (item1 in list1) {
        // Check if the element is present in the second list
        if (item1 in list2) {
            intersection.add(item1)
        }
    }

    // Return the intersection
    return intersection
}