Iterative Approach with Vowel Check and String Manipulation
Split the sentence into words.
Initialize an empty string to store the final Goat Latin sentence.
Iterate over each word in the sentence.
a. Check if the word starts with a vowel (both lowercase and uppercase are considered).
b. If it does, append 'ma' to the word.
c. If it doesn't, move the first letter to the end of the word and then append 'ma'.
For each word, append a sequence of 'a' characters, where the number of 'a's is equal to the word's index in the sentence starting with 1.
Add each modified word to the final Goat Latin sentence, separated by spaces.