/**
 * Given two lists, return a new list with the common elements.
 *
 * @param list1 A list of elements
 * @param list2 Another list of elements
 * @return A new list containing the common elements from list1 and list2
 *
 * Example:
 * findCommonElements(listOf('a', 'b', 'c', 'd'), listOf('b', 'd', 'e')) // Output: ['b', 'd']
 * findCommonElements(listOf(1, 2, 3, 4, 5), listOf(3, 4, 5, 6, 7)) // Output: [3, 4, 5]
 */
fun findCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {

    val commonElements = list1.filter { it in list2 }
    return commonElements
}
/**
 * Given two lists, return a new list with the common elements.
 *
 * @param list1 A list of elements
 * @param list2 Another list of elements
 * @return A new list containing the common elements from list1 and list2
 *
 * Example:
 * findCommonElements(listOf('a', 'b', 'c', 'd'), listOf('b', 'd', 'e')) // Output: ['b', 'd']
 * findCommonElements(listOf(1, 2, 3, 4, 5), listOf(3, 4, 5, 6, 7)) // Output: [3, 4, 5]
 */
fun findCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {
/**
 * Given two lists, return a new list with the common elements.
 *
 * @param list1 A list of elements
 * @param list2 Another list of elements
 * @return A new list containing the common elements from list1 and list2
 *
 * Example:
 * findCommonElements(listOf('a', 'b', 'c', 'd'), listOf('b', 'd', 'e')) // Output: ['b', 'd']
 * findCommonElements(listOf(1, 2, 3, 4, 5), listOf(3, 4, 5, 6, 7)) // Output: [3, 4, 5]
 */
fun findCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {

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