/**
 * Given two lists, return a tuple containing the elements that are common to both lists.
 *
 * @param list1 The first list.
 * @param list2 The second list.
 * @return A tuple containing the common elements between the two lists.
 *
 * Example:
 * findCommonElements(listOf(1, 2, 3, 4, 5), listOf(4, 5, 6, 7, 8)) // Returns (4, 5)
 * findCommonElements(listOf("apple", "banana", "kiwi"), listOf("kiwi", "mango")) // Returns ("kiwi")
 */
fun findCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {

    val commonElements = list1.filter { it in list2 }
    return commonElements
}
/**
 * Given two lists, return a tuple containing the elements that are common to both lists.
 *
 * @param list1 The first list.
 * @param list2 The second list.
 * @return A tuple containing the common elements between the two lists.
 *
 * Example:
 * findCommonElements(listOf(1, 2, 3, 4, 5), listOf(4, 5, 6, 7, 8)) // Returns (4, 5)
 * findCommonElements(listOf("apple", "banana", "kiwi"), listOf("kiwi", "mango")) // Returns ("kiwi")
 */
fun findCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {
/**
 * Given two lists, return a tuple containing the elements that are common to both lists.
 *
 * @param list1 The first list.
 * @param list2 The second list.
 * @return A tuple containing the common elements between the two lists.
 *
 * Example:
 * findCommonElements(listOf(1, 2, 3, 4, 5), listOf(4, 5, 6, 7, 8)) // Returns (4, 5)
 * findCommonElements(listOf("apple", "banana", "kiwi"), listOf("kiwi", "mango")) // Returns ("kiwi")
 */
fun findCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {

    val commonElements = list1.filter { it in list2 }
    return commonElements
}