/**
 * Given two lists, return a list of pairs with the index of the common elements in both lists.
 */
fun indexOfCommonElements(list1: List<Any>, list2: List<Any>): List<Pair<Int, Int>> {

    val indexOfCommon = mutableListOf<Pair<Int, Int>>()

    for (element in list1) {
        if (element in list2) {
            val indexOfList1 = list1.indexOf(element)
            val indexOfList2 = list2.indexOf(element)
            indexOfCommon.add(indexOfList1 to indexOfList2)
        }
    }

    return indexOfCommon
}
/**
 * Given two lists, return a list of pairs with the index of the common elements in both lists.
 */
fun indexOfCommonElements(list1: List<Any>, list2: List<Any>): List<Pair<Int, Int>> {
/**
 * Given two lists, return a list of pairs with the index of the common elements in both lists.
 */
fun indexOfCommonElements(list1: List<Any>, list2: List<Any>): List<Pair<Int, Int>> {

    val indexOfCommon = mutableListOf<Pair<Int, Int>>()

    for (element in list1) {
        if (element in list2) {
            val indexOfList1 = list1.indexOf(element)
            val indexOfList2 = list2.indexOf(element)
            indexOfCommon.add(indexOfList1 to indexOfList2)
        }
    }

    return indexOfCommon
}