/**
 * Given two lists, find the common elements between them using the complement operator.
 *
 * @param list1 First list containing elements
 * @param list2 Second list containing elements
 * @return A list containing the elements common to both input lists
 */
fun findCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {

    // Find the complement of list1
    val complementList1 = list1.filter { it !in list2 }

    // Find the complement of list2
    val complementList2 = list2.filter { it !in list1 }

    // Find the common elements by finding the complement of complementList1
    val commonElements = list1.filter { it in complementList1 }

    // Return the common elements
    return commonElements
}
/**
 * Given two lists, find the common elements between them using the complement operator.
 *
 * @param list1 First list containing elements
 * @param list2 Second list containing elements
 * @return A list containing the elements common to both input lists
 */
fun findCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {
/**
 * Given two lists, find the common elements between them using the complement operator.
 *
 * @param list1 First list containing elements
 * @param list2 Second list containing elements
 * @return A list containing the elements common to both input lists
 */
fun findCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {

    // Find the complement of list1
    val complementList1 = list1.filter { it !in list2 }

    // Find the complement of list2
    val complementList2 = list2.filter { it !in list1 }

    // Find the common elements by finding the complement of complementList1
    val commonElements = list1.filter { it in complementList1 }

    // Return the common elements
    return commonElements
}