/**
 * Geologist exercise:
 * 
 * Given two lists of elements, find the common elements in both lists.
 * The function should return a new list containing the common elements.
 */
fun findCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {

    val commonElements = mutableListOf<Any>()

    for (element in list1) {
        if (element in list2) {
            commonElements.add(element)
            // Since we have found a common element, there is no need to check further
            // and we can break out of the loop.
            break
        }
    }

    return commonElements
}
/**
 * Geologist exercise:
 * 
 * Given two lists of elements, find the common elements in both lists.
 * The function should return a new list containing the common elements.
 */
fun findCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {
/**
 * Geologist exercise:
 * 
 * Given two lists of elements, find the common elements in both lists.
 * The function should return a new list containing the common elements.
 */
fun findCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {

    val commonElements = mutableListOf<Any>()

    for (element in list1) {
        if (element in list2) {
            commonElements.add(element)
            // Since we have found a common element, there is no need to check further
            // and we can break out of the loop.
            break
        }
    }

    return commonElements
}