/**
 * This function takes two lists as input and finds the common indices of elements
 * that are equal in both lists.
 *
 * @param list1 The first list.
 * @param list2 The second list.
 * @return A list of common indices.
 */
fun findCommonIndices(list1: List<Any>, list2: List<Any>): List<Int> {

    val commonIndices = mutableListOf<Int>()

    // Iterate through each index of the first list
    for (index in list1.indices) {
        // Check if the element at the same index in the second list is equal
        if (index < list2.size && list1[index] == list2[index]) {
            // If it is, add the index to the commonIndices list
            commonIndices.add(index)
        }
    }

    return commonIndices
}
/**
 * This function takes two lists as input and finds the common indices of elements
 * that are equal in both lists.
 *
 * @param list1 The first list.
 * @param list2 The second list.
 * @return A list of common indices.
 */
fun findCommonIndices(list1: List<Any>, list2: List<Any>): List<Int> {
/**
 * This function takes two lists as input and finds the common indices of elements
 * that are equal in both lists.
 *
 * @param list1 The first list.
 * @param list2 The second list.
 * @return A list of common indices.
 */
fun findCommonIndices(list1: List<Any>, list2: List<Any>): List<Int> {

    val commonIndices = mutableListOf<Int>()

    // Iterate through each index of the first list
    for (index in list1.indices) {
        // Check if the element at the same index in the second list is equal
        if (index < list2.size && list1[index] == list2[index]) {
            // If it is, add the index to the commonIndices list
            commonIndices.add(index)
        }
    }

    return commonIndices
}