/**
 * A function that counts the number of vowels and consonants in a given string.
 *
 * @param string A string of characters
 * @return A Pair containing the count of vowels and consonants respectively
 */
// Refactored function using a when statement to increment vowel_count and consonant_count separately
fun countVowelsConsonants(string: String): Pair<Int, Int> {

    val vowels = setOf('a', 'e', 'i', 'o', 'u')
    var vowelCount = 0
    var consonantCount = 0

    for (char in string) {
        when {
            char.toLowerCase() in vowels -> vowelCount++
            char.isLetter() -> consonantCount++
        }
    }

    return Pair(vowelCount, consonantCount)
}
/**
 * A function that counts the number of vowels and consonants in a given string.
 *
 * @param string A string of characters
 * @return A Pair containing the count of vowels and consonants respectively
 */
// Refactored function using a when statement to increment vowel_count and consonant_count separately
fun countVowelsConsonants(string: String): Pair<Int, Int> {
/**
 * A function that counts the number of vowels and consonants in a given string.
 *
 * @param string A string of characters
 * @return A Pair containing the count of vowels and consonants respectively
 */
// Refactored function using a when statement to increment vowel_count and consonant_count separately
fun countVowelsConsonants(string: String): Pair<Int, Int> {

    val vowels = setOf('a', 'e', 'i', 'o', 'u')
    var vowelCount = 0
    var consonantCount = 0

    for (char in string) {
        when {
            char.toLowerCase() in vowels -> vowelCount++
            char.isLetter() -> consonantCount++
        }
    }

    return Pair(vowelCount, consonantCount)
}