/**
 * This function takes two lists as input and returns the common elements between them.
 */
fun findCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {

    val commonElements = mutableListOf<Any>()
    var i = 0

    while (i < list1.size) {  // Iterate over each element in list1
        if (list1[i] !in list2) {  // Check if the element is not in list2
            i++
            continue
        }
        commonElements.add(list1[i])  // Add the element to the commonElements list
        i++  // Move to the next element
    }

    return commonElements
}
/**
 * This function takes two lists as input and returns the common elements between them.
 */
fun findCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {
/**
 * This function takes two lists as input and returns the common elements between them.
 */
fun findCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {

    val commonElements = mutableListOf<Any>()
    var i = 0

    while (i < list1.size) {  // Iterate over each element in list1
        if (list1[i] !in list2) {  // Check if the element is not in list2
            i++
            continue
        }
        commonElements.add(list1[i])  // Add the element to the commonElements list
        i++  // Move to the next element
    }

    return commonElements
}