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

    // Use the indices function to generate a set of all indices in list1
    val set1 = list1.indices.toSet()

    // Use the indices function to generate a set of all indices in list2
    val set2 = list2.indices.toSet()

    // Find the intersection of set1 and set2 using the 'intersect" function and convert it to a list
    val commonElements = set1.intersect(set2).toList()

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

    // Use the indices function to generate a set of all indices in list1
    val set1 = list1.indices.toSet()

    // Use the indices function to generate a set of all indices in list2
    val set2 = list2.indices.toSet()

    // Find the intersection of set1 and set2 using the 'intersect" function and convert it to a list
    val commonElements = set1.intersect(set2).toList()

    return commonElements
}