/**
 * Write a function that takes in two lists and returns a new list containing the common elements
 * between the two lists. Use the AND operator and control flow within nested loops to solve the exercise.
 */
fun findCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {

    val commonElements = mutableListOf<Any>()  // empty list to store common elements

    for (element1 in list1) {  // iterate over elements in list1
        for (element2 in list2) {  // iterate over elements in list2
            if (element1 == element2) {  // check if elements are equal
                commonElements.add(element1)  // add common element to the list
            }
        }
    }

    return commonElements
}
/**
 * Write a function that takes in two lists and returns a new list containing the common elements
 * between the two lists. Use the AND operator and control flow within nested loops to solve the exercise.
 */
fun findCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {
/**
 * Write a function that takes in two lists and returns a new list containing the common elements
 * between the two lists. Use the AND operator and control flow within nested loops to solve the exercise.
 */
fun findCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {

    val commonElements = mutableListOf<Any>()  // empty list to store common elements

    for (element1 in list1) {  // iterate over elements in list1
        for (element2 in list2) {  // iterate over elements in list2
            if (element1 == element2) {  // check if elements are equal
                commonElements.add(element1)  // add common element to the list
            }
        }
    }

    return commonElements
}