/**
 * This function takes in two lists and returns a new list containing the elements that are common in both lists.
 *
 * @param list1 The first list.
 * @param list2 The second list.
 * @return A new list containing the common elements.
 */
fun copyListIntersection(list1: List<Any>, list2: List<Any>): List<Any> {

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

    // Iterate through each element in list1
    for (element in list1) {
        // Check if the element exists in list2 and it is not already in the commonElements list
        if (element in list2 && element !in commonElements) {
            // Add the element to the commonElements list
            commonElements.add(element)
        }
    }

    return commonElements
}
/**
 * This function takes in two lists and returns a new list containing the elements that are common in both lists.
 *
 * @param list1 The first list.
 * @param list2 The second list.
 * @return A new list containing the common elements.
 */
fun copyListIntersection(list1: List<Any>, list2: List<Any>): List<Any> {
/**
 * This function takes in two lists and returns a new list containing the elements that are common in both lists.
 *
 * @param list1 The first list.
 * @param list2 The second list.
 * @return A new list containing the common elements.
 */
fun copyListIntersection(list1: List<Any>, list2: List<Any>): List<Any> {

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

    // Iterate through each element in list1
    for (element in list1) {
        // Check if the element exists in list2 and it is not already in the commonElements list
        if (element in list2 && element !in commonElements) {
            // Add the element to the commonElements list
            commonElements.add(element)
        }
    }

    return commonElements
}