/**
 * Given two lists, list1 and list2, write a function to count the number of elements that are common to both lists.
 *
 * @param list1 A list containing elements of any type.
 * @param list2 A list containing elements of any type.
 * @return The count of elements that are common to both lists.
 */
fun countCommonElements(list1: List<Any>, list2: List<Any>): Int {

    var commonElements = 0

    for (element1 in list1) {
        for (element2 in list2) {
            if (element1 == element2) {
                commonElements++
            }
        }
    }

    return commonElements
}
/**
 * Given two lists, list1 and list2, write a function to count the number of elements that are common to both lists.
 *
 * @param list1 A list containing elements of any type.
 * @param list2 A list containing elements of any type.
 * @return The count of elements that are common to both lists.
 */
fun countCommonElements(list1: List<Any>, list2: List<Any>): Int {
/**
 * Given two lists, list1 and list2, write a function to count the number of elements that are common to both lists.
 *
 * @param list1 A list containing elements of any type.
 * @param list2 A list containing elements of any type.
 * @return The count of elements that are common to both lists.
 */
fun countCommonElements(list1: List<Any>, list2: List<Any>): Int {

    var commonElements = 0

    for (element1 in list1) {
        for (element2 in list2) {
            if (element1 == element2) {
                commonElements++
            }
        }
    }

    return commonElements
}