plaintext
function transformString(s)
vowels := "aeiouy"
result := ""
for each character c in s lowerC := tolower(c)
if lowerC is not in vowels then
result := result + "." + lowerC
return result
You check each character against the vowel set. If it's not a vowel, you append a dot and the lowercase character. The result string grows as you process the input from left to right. Vowel checking uses a set or string of vowels for O(1) lookup. Converting to lowercase simplifies the check. For each consonant, prepend a dot. Building the result string character by character keeps the logic clear. c" for each consonant c.