/**
 * This function takes two lists as input and returns the common elements using list comprehension and a for loop.
 *
 * @param list1 First input list
 * @param list2 Second input list
 * @return List of common elements
 */
fun commonElements(list1: List<Any>, list2: List<Any>): List<Any> {

    // Your code here
    val common = list1.filter { element -> list2.any { it == element } }

    return common
}
/**
 * This function takes two lists as input and returns the common elements using list comprehension and a for loop.
 *
 * @param list1 First input list
 * @param list2 Second input list
 * @return List of common elements
 */
fun commonElements(list1: List<Any>, list2: List<Any>): List<Any> {
/**
 * This function takes two lists as input and returns the common elements using list comprehension and a for loop.
 *
 * @param list1 First input list
 * @param list2 Second input list
 * @return List of common elements
 */
fun commonElements(list1: List<Any>, list2: List<Any>): List<Any> {

    // Your code here
    val common = list1.filter { element -> list2.any { it == element } }

    return common
}