/**
 * Return the number of common elements that appear in both the tuple and the list.
 *
 * @param a A tuple of elements
 * @param b A list of elements
 * @return An integer representing the count of common elements
 *
 * Example:
 * countCommonElements(listOf(1, 2, 3, 4, 5), listOf(4, 5, 6, 7, 8)) returns 2 as 4 and 5 appear in both the tuple and the list.
 */
fun countCommonElements(a: List<Int>, b: List<Int>): Int {

    var count = 0

    for (item in a) {
        for (element in b) {
            if (item == element) {
                count++
            }
        }
    }

    return count
}
/**
 * Return the number of common elements that appear in both the tuple and the list.
 *
 * @param a A tuple of elements
 * @param b A list of elements
 * @return An integer representing the count of common elements
 *
 * Example:
 * countCommonElements(listOf(1, 2, 3, 4, 5), listOf(4, 5, 6, 7, 8)) returns 2 as 4 and 5 appear in both the tuple and the list.
 */
fun countCommonElements(a: List<Int>, b: List<Int>): Int {
/**
 * Return the number of common elements that appear in both the tuple and the list.
 *
 * @param a A tuple of elements
 * @param b A list of elements
 * @return An integer representing the count of common elements
 *
 * Example:
 * countCommonElements(listOf(1, 2, 3, 4, 5), listOf(4, 5, 6, 7, 8)) returns 2 as 4 and 5 appear in both the tuple and the list.
 */
fun countCommonElements(a: List<Int>, b: List<Int>): Int {

    var count = 0

    for (item in a) {
        for (element in b) {
            if (item == element) {
                count++
            }
        }
    }

    return count
}