
"""Count vowels in a string."""

def count_vowels(s):
    """Count the number of vowels (a, e, i, o, u) in a given string."""
    
    # Define a set of vowels for O(1) lookup
    vowel_set = {'a', 'e', 'i', 'o', 'u'}
    
    count = 0
    
    # Iterate through each character in the string and check if it's a vowel
    for char in s.lower():  # Convert to lowercase to make case insensitivity explicit
        if char in vowel_set:
            count += 1
            
    return count

