/**
 * This function takes in two lists and returns a new list
 * containing the common elements between them. Each element in
 * the list will be the intersection of the two input lists.
 */
fun getCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {

    // Find the common elements using nested loops
    val commonElements = mutableListOf<Any>()
    for (element1 in list1) {
        for (element2 in list2) {
            if (element1 == element2) {
                commonElements.add(element1)
            }
        }
    }
    return commonElements
}
/**
 * This function takes in two lists and returns a new list
 * containing the common elements between them. Each element in
 * the list will be the intersection of the two input lists.
 */
fun getCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {
/**
 * This function takes in two lists and returns a new list
 * containing the common elements between them. Each element in
 * the list will be the intersection of the two input lists.
 */
fun getCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {

    // Find the common elements using nested loops
    val commonElements = mutableListOf<Any>()
    for (element1 in list1) {
        for (element2 in list2) {
            if (element1 == element2) {
                commonElements.add(element1)
            }
        }
    }
    return commonElements
}