/**
 * Given an array of tuples, count the number of tuples that have at least one element containing the character 'a'.
 * Return the count.
 *
 * @param array a list of tuples
 * @return count an integer representing the number of tuples with 'a' as an element
 *
 * Example:
 * countSpecialElements(listOf(1 to "apple", "banana" to 2, 3 to "grape")) -> 2
 */
fun countSpecialElements(array: List<Pair<Any, Any>>): Int {

    var count = 0
    for (tuple in array) {
        for (element in tuple.toList()) {
            if (element is String && 'a' in element) {
                count++
                break
            }
        }
    }
    return count
}
/**
 * Given an array of tuples, count the number of tuples that have at least one element containing the character 'a'.
 * Return the count.
 *
 * @param array a list of tuples
 * @return count an integer representing the number of tuples with 'a' as an element
 *
 * Example:
 * countSpecialElements(listOf(1 to "apple", "banana" to 2, 3 to "grape")) -> 2
 */
fun countSpecialElements(array: List<Pair<Any, Any>>): Int {
/**
 * Given an array of tuples, count the number of tuples that have at least one element containing the character 'a'.
 * Return the count.
 *
 * @param array a list of tuples
 * @return count an integer representing the number of tuples with 'a' as an element
 *
 * Example:
 * countSpecialElements(listOf(1 to "apple", "banana" to 2, 3 to "grape")) -> 2
 */
fun countSpecialElements(array: List<Pair<Any, Any>>): Int {

    var count = 0
    for (tuple in array) {
        for (element in tuple.toList()) {
            if (element is String && 'a' in element) {
                count++
                break
            }
        }
    }
    return count
}