/**
 * Given two lists, determine if they have any common elements.
 *
 * @param list1 A list of elements (integers or strings).
 * @param list2 A list of elements (integers or strings).
 * @return True if the lists have at least one common element, False otherwise.
 *
 * Example:
 * hasCommonElements(listOf(1, 2, 3), listOf(3, 4, 5)) -> true
 * hasCommonElements(listOf("apple", "banana", "cherry"), listOf("grape", "kiwi", "mango")) -> false
 */
fun hasCommonElements(list1: List<Any>, list2: List<Any>): Boolean {

    for (item1 in list1) {
        for (item2 in list2) {
            if (item1 == item2) {
                // There is a common element, return true
                return true
            }
        }
    }
    // No common elements found
    return false
}
/**
 * Given two lists, determine if they have any common elements.
 *
 * @param list1 A list of elements (integers or strings).
 * @param list2 A list of elements (integers or strings).
 * @return True if the lists have at least one common element, False otherwise.
 *
 * Example:
 * hasCommonElements(listOf(1, 2, 3), listOf(3, 4, 5)) -> true
 * hasCommonElements(listOf("apple", "banana", "cherry"), listOf("grape", "kiwi", "mango")) -> false
 */
fun hasCommonElements(list1: List<Any>, list2: List<Any>): Boolean {
/**
 * Given two lists, determine if they have any common elements.
 *
 * @param list1 A list of elements (integers or strings).
 * @param list2 A list of elements (integers or strings).
 * @return True if the lists have at least one common element, False otherwise.
 *
 * Example:
 * hasCommonElements(listOf(1, 2, 3), listOf(3, 4, 5)) -> true
 * hasCommonElements(listOf("apple", "banana", "cherry"), listOf("grape", "kiwi", "mango")) -> false
 */
fun hasCommonElements(list1: List<Any>, list2: List<Any>): Boolean {

    for (item1 in list1) {
        for (item2 in list2) {
            if (item1 == item2) {
                // There is a common element, return true
                return true
            }
        }
    }
    // No common elements found
    return false
}