/**
 * Given two lists, find the indexes of elements that are common to both lists.
 * Return a list of tuples containing the common element and its corresponding indexes.
 */
fun intersectionIndexes(listA: List<Any>, listB: List<Any>): List<Triple<Any, Int, Int>> {

    val commonElements = mutableListOf<Triple<Any, Int, Int>>() // Stores the common elements and their indexes

    // Iterate over the elements of listA
    for ((indexA, elemA) in listA.withIndex()) {
        // Check if the element exists in listB and get its index
        if (elemA in listB) {
            val indexB = listB.indexOf(elemA)
            // Append the element and its index as a triple to commonElements list
            commonElements.add(Triple(elemA, indexA, indexB))
        }
    }

    return commonElements
}
/**
 * Given two lists, find the indexes of elements that are common to both lists.
 * Return a list of tuples containing the common element and its corresponding indexes.
 */
fun intersectionIndexes(listA: List<Any>, listB: List<Any>): List<Triple<Any, Int, Int>> {
/**
 * Given two lists, find the indexes of elements that are common to both lists.
 * Return a list of tuples containing the common element and its corresponding indexes.
 */
fun intersectionIndexes(listA: List<Any>, listB: List<Any>): List<Triple<Any, Int, Int>> {

    val commonElements = mutableListOf<Triple<Any, Int, Int>>() // Stores the common elements and their indexes

    // Iterate over the elements of listA
    for ((indexA, elemA) in listA.withIndex()) {
        // Check if the element exists in listB and get its index
        if (elemA in listB) {
            val indexB = listB.indexOf(elemA)
            // Append the element and its index as a triple to commonElements list
            commonElements.add(Triple(elemA, indexA, indexB))
        }
    }

    return commonElements
}