/**
 * This function takes two lists as input and returns the count of common elements between them.
 *
 * @param list1 A list of elements
 * @param list2 Another list of elements
 * @return The count of common elements between list1 and list2
 *
 * Example:
 * countCommonElements(listOf(1, 2, 3, 4, 5), listOf(4, 5, 6, 7, 8)) --> 2
 */
fun countCommonElements(list1: List<Int>, list2: List<Int>): Int {

    val commonElements = list1.toSet() intersect list2.toSet()
    return commonElements.size
}
/**
 * This function takes two lists as input and returns the count of common elements between them.
 *
 * @param list1 A list of elements
 * @param list2 Another list of elements
 * @return The count of common elements between list1 and list2
 *
 * Example:
 * countCommonElements(listOf(1, 2, 3, 4, 5), listOf(4, 5, 6, 7, 8)) --> 2
 */
fun countCommonElements(list1: List<Int>, list2: List<Int>): Int {
/**
 * This function takes two lists as input and returns the count of common elements between them.
 *
 * @param list1 A list of elements
 * @param list2 Another list of elements
 * @return The count of common elements between list1 and list2
 *
 * Example:
 * countCommonElements(listOf(1, 2, 3, 4, 5), listOf(4, 5, 6, 7, 8)) --> 2
 */
fun countCommonElements(list1: List<Int>, list2: List<Int>): Int {

    val commonElements = list1.toSet() intersect list2.toSet()
    return commonElements.size
}