/**
 * Astronomers often need to count the number of vowels in a string.
 * Complete the following function to count the number of vowels (a, e, i, o, u) in the given word.
 *
 * @param word The word in which vowels need to be counted.
 * @return The count of vowels in the word.
 *
 * Example:
 * countVowels("astronomy") returns 3
 * countVowels("galaxy") returns 2
 */
fun countVowels(word: String): Int {

    // Initialize a counter variable
    var count = 0

    // Iterate through each character in the word
    var index = 0
    while (index < word.length) {
        // Check if the current character is a vowel (a, e, i, o, u)
        if (word[index].toLowerCase() in listOf('a', 'e', 'i', 'o', 'u')) {
            // Increment the counter if it is a vowel
            count++
        }
        // Move to the next character in the word
        index++
    }

    return count
}
/**
 * Astronomers often need to count the number of vowels in a string.
 * Complete the following function to count the number of vowels (a, e, i, o, u) in the given word.
 *
 * @param word The word in which vowels need to be counted.
 * @return The count of vowels in the word.
 *
 * Example:
 * countVowels("astronomy") returns 3
 * countVowels("galaxy") returns 2
 */
fun countVowels(word: String): Int {
/**
 * Astronomers often need to count the number of vowels in a string.
 * Complete the following function to count the number of vowels (a, e, i, o, u) in the given word.
 *
 * @param word The word in which vowels need to be counted.
 * @return The count of vowels in the word.
 *
 * Example:
 * countVowels("astronomy") returns 3
 * countVowels("galaxy") returns 2
 */
fun countVowels(word: String): Int {

    // Initialize a counter variable
    var count = 0

    // Iterate through each character in the word
    var index = 0
    while (index < word.length) {
        // Check if the current character is a vowel (a, e, i, o, u)
        if (word[index].toLowerCase() in listOf('a', 'e', 'i', 'o', 'u')) {
            // Increment the counter if it is a vowel
            count++
        }
        // Move to the next character in the word
        index++
    }

    return count
}