/**
 * This function takes two lists as input and returns a list of common elements present in both lists.
 *
 * @param list1 The first list.
 * @param list2 The second list.
 * @return A list of common elements from list1 and list2.
 *
 * Example:
 * findCommonElements(listOf(2, 4, 6, 8), listOf(1, 2, 3, 4)) // [2, 4]
 * findCommonElements(listOf("apple", "banana", "orange"), listOf("orange", "kiwi")) // ["orange"]
 */
fun findCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {

    return list1.filter { it in list2 }
}
/**
 * This function takes two lists as input and returns a list of common elements present in both lists.
 *
 * @param list1 The first list.
 * @param list2 The second list.
 * @return A list of common elements from list1 and list2.
 *
 * Example:
 * findCommonElements(listOf(2, 4, 6, 8), listOf(1, 2, 3, 4)) // [2, 4]
 * findCommonElements(listOf("apple", "banana", "orange"), listOf("orange", "kiwi")) // ["orange"]
 */
fun findCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {
/**
 * This function takes two lists as input and returns a list of common elements present in both lists.
 *
 * @param list1 The first list.
 * @param list2 The second list.
 * @return A list of common elements from list1 and list2.
 *
 * Example:
 * findCommonElements(listOf(2, 4, 6, 8), listOf(1, 2, 3, 4)) // [2, 4]
 * findCommonElements(listOf("apple", "banana", "orange"), listOf("orange", "kiwi")) // ["orange"]
 */
fun findCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {

    return list1.filter { it in list2 }
}