Skip to content

Commit

Permalink
824
Browse files Browse the repository at this point in the history
  • Loading branch information
isinsuarici committed Mar 12, 2022
1 parent 7d79671 commit 3875ce7
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions E_824_GoatLatin.py
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 3875ce7

Please sign in to comment.