/**
 * This exercise requires the completion of a function that finds the common elements between two lists using the enumerate function and repetition.
 *
 * @param list1 The first list containing elements.
 * @param list2 The second list containing elements.
 * @return A list containing the common elements between the two input lists.
 */
fun findCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {

    val commonElements = mutableListOf<Any>()

    // Loop through each element and its index in list1 using the enumerate function
    for ((index1, element1) in list1.withIndex()) {
        // Loop through each element in list2 using repetition
        for (element2 in list2) {
            if (element1 == element2) {
                commonElements.add(element1)
                break  // Break the inner loop once a common element is found
            }
        }
    }

    return commonElements
}
/**
 * This exercise requires the completion of a function that finds the common elements between two lists using the enumerate function and repetition.
 *
 * @param list1 The first list containing elements.
 * @param list2 The second list containing elements.
 * @return A list containing the common elements between the two input lists.
 */
fun findCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {
/**
 * This exercise requires the completion of a function that finds the common elements between two lists using the enumerate function and repetition.
 *
 * @param list1 The first list containing elements.
 * @param list2 The second list containing elements.
 * @return A list containing the common elements between the two input lists.
 */
fun findCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {

    val commonElements = mutableListOf<Any>()

    // Loop through each element and its index in list1 using the enumerate function
    for ((index1, element1) in list1.withIndex()) {
        // Loop through each element in list2 using repetition
        for (element2 in list2) {
            if (element1 == element2) {
                commonElements.add(element1)
                break  // Break the inner loop once a common element is found
            }
        }
    }

    return commonElements
}