/**
 * Given two lists, find and return the common elements between them.
 *
 * @param list1 The first list.
 * @param list2 The second list.
 * @return A list of common elements between list1 and list2.
 */
fun findCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {

    val commonElements = mutableListOf<Any>()

    // Loop through each element in list1
    for (elem1 in list1) {
        // Loop through each element in list2
        for (elem2 in list2) {
            // Check if the elements are equal
            if (elem1 == elem2) {
                commonElements.add(elem1)
            }
        }
    }

    return commonElements
}
/**
 * Given two lists, find and return the common elements between them.
 *
 * @param list1 The first list.
 * @param list2 The second list.
 * @return A list of common elements between list1 and list2.
 */
fun findCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {
/**
 * Given two lists, find and return the common elements between them.
 *
 * @param list1 The first list.
 * @param list2 The second list.
 * @return A list of common elements between list1 and list2.
 */
fun findCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {

    val commonElements = mutableListOf<Any>()

    // Loop through each element in list1
    for (elem1 in list1) {
        // Loop through each element in list2
        for (elem2 in list2) {
            // Check if the elements are equal
            if (elem1 == elem2) {
                commonElements.add(elem1)
            }
        }
    }

    return commonElements
}