/**
 * Given two lists, implement a function that returns true if they have at least one element in common,
 * and false otherwise. The function should use the identity comparison method to check for common elements,
 * and convert the input lists into sets for easier comparison.
 *
 * @param list1 The first list of elements
 * @param list2 The second list of elements
 * @return true if there is at least one common element, false otherwise
 */
fun compareSets(list1: List<Any>, list2: List<Any>): Boolean {

    val set1 = list1.toSet()  // Convert list1 into a set
    val set2 = list2.toSet()  // Convert list2 into a set

    for (element in set1) {  // Iterate through elements in set1
        if (element in set2) {  // Check if the element is also present in set2
            return true  // Return true if a common element is found
        }
    }
    
    return false  // Return false if no common elements are found
}
/**
 * Given two lists, implement a function that returns true if they have at least one element in common,
 * and false otherwise. The function should use the identity comparison method to check for common elements,
 * and convert the input lists into sets for easier comparison.
 *
 * @param list1 The first list of elements
 * @param list2 The second list of elements
 * @return true if there is at least one common element, false otherwise
 */
fun compareSets(list1: List<Any>, list2: List<Any>): Boolean {
/**
 * Given two lists, implement a function that returns true if they have at least one element in common,
 * and false otherwise. The function should use the identity comparison method to check for common elements,
 * and convert the input lists into sets for easier comparison.
 *
 * @param list1 The first list of elements
 * @param list2 The second list of elements
 * @return true if there is at least one common element, false otherwise
 */
fun compareSets(list1: List<Any>, list2: List<Any>): Boolean {

    val set1 = list1.toSet()  // Convert list1 into a set
    val set2 = list2.toSet()  // Convert list2 into a set

    for (element in set1) {  // Iterate through elements in set1
        if (element in set2) {  // Check if the element is also present in set2
            return true  // Return true if a common element is found
        }
    }
    
    return false  // Return false if no common elements are found
}