/**
 * Given two lists, find the common elements between them and return a list with the common elements as its elements.
 * The function should not modify the original lists.
 *
 * Example:
 * findCommonElements(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) => [3, 4]
 *
 * @param list1 A list of elements (can be of any type)
 * @param list2 A list of elements (can be of any type)
 * @return A list containing the common elements between list1 and list2
 *
 * Note:
 * - The order of the elements in the list does not matter
 * - If there are no common elements, the function should return an empty list
 */
fun findCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {

    val commonElements = list1.filter { it in list2 }
    return commonElements
}
/**
 * Given two lists, find the common elements between them and return a list with the common elements as its elements.
 * The function should not modify the original lists.
 *
 * Example:
 * findCommonElements(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) => [3, 4]
 *
 * @param list1 A list of elements (can be of any type)
 * @param list2 A list of elements (can be of any type)
 * @return A list containing the common elements between list1 and list2
 *
 * Note:
 * - The order of the elements in the list does not matter
 * - If there are no common elements, the function should return an empty list
 */
fun findCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {
/**
 * Given two lists, find the common elements between them and return a list with the common elements as its elements.
 * The function should not modify the original lists.
 *
 * Example:
 * findCommonElements(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) => [3, 4]
 *
 * @param list1 A list of elements (can be of any type)
 * @param list2 A list of elements (can be of any type)
 * @return A list containing the common elements between list1 and list2
 *
 * Note:
 * - The order of the elements in the list does not matter
 * - If there are no common elements, the function should return an empty list
 */
fun findCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {

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