/**
 * This function takes two lists as arguments and returns a new list with the common elements from both lists.
 */
fun intersectLists(list1: List<Any>, list2: List<Any>): List<Any> {

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

    // Iterate over each element in list1
    for (element1 in list1) {
        // Iterate over each element in list2
        for (element2 in list2) {
            // Check if the element is common to both lists and not already in commonElements
            if (element1 == element2 && element1 !in commonElements) {
                // Add the element to the commonElements list
                commonElements.add(element1)
            }
        }
    }

    return commonElements
}
/**
 * This function takes two lists as arguments and returns a new list with the common elements from both lists.
 */
fun intersectLists(list1: List<Any>, list2: List<Any>): List<Any> {
/**
 * This function takes two lists as arguments and returns a new list with the common elements from both lists.
 */
fun intersectLists(list1: List<Any>, list2: List<Any>): List<Any> {

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

    // Iterate over each element in list1
    for (element1 in list1) {
        // Iterate over each element in list2
        for (element2 in list2) {
            // Check if the element is common to both lists and not already in commonElements
            if (element1 == element2 && element1 !in commonElements) {
                // Add the element to the commonElements list
                commonElements.add(element1)
            }
        }
    }

    return commonElements
}