/**
 * This function finds the intersection of two lists and returns a new list containing the common elements.
 *
 * @param list1 First input list.
 * @param list2 Second input list.
 * @return A new list containing the intersecting elements from list1 and list2.
 */
fun findIntersection(list1: List<Any>, list2: List<Any>): List<Any> {

    val intersection = mutableListOf<Any>()

    // Loop through the elements in list1
    for (element in list1) {
        // Check if the element exists in list2
        if (element in list2) {
            // Add the common element to the intersection list
            intersection.add(element)
        }
    }

    return intersection
}
/**
 * This function finds the intersection of two lists and returns a new list containing the common elements.
 *
 * @param list1 First input list.
 * @param list2 Second input list.
 * @return A new list containing the intersecting elements from list1 and list2.
 */
fun findIntersection(list1: List<Any>, list2: List<Any>): List<Any> {
/**
 * This function finds the intersection of two lists and returns a new list containing the common elements.
 *
 * @param list1 First input list.
 * @param list2 Second input list.
 * @return A new list containing the intersecting elements from list1 and list2.
 */
fun findIntersection(list1: List<Any>, list2: List<Any>): List<Any> {

    val intersection = mutableListOf<Any>()

    // Loop through the elements in list1
    for (element in list1) {
        // Check if the element exists in list2
        if (element in list2) {
            // Add the common element to the intersection list
            intersection.add(element)
        }
    }

    return intersection
}