diff --git a/E_824_GoatLatin.py b/E_824_GoatLatin.py new file mode 100644 index 0000000..99d402e --- /dev/null +++ b/E_824_GoatLatin.py @@ -0,0 +1,13 @@ +class Solution: + def toGoatLatin(self, sentence: str) -> str: + tokens=sentence.split() + + for token in tokens: + if token[0] in 'AEIOUaeiou': + tokens[tokens.index(token)]=token+"ma"+(tokens.index(token)+1)*"a" + + else: + tokens[tokens.index(token)]=token[1:]+token[0]+"ma"+(tokens.index(token)+1)*"a" + + return ' '.join(tokens) + \ No newline at end of file