Leetcode 824 Goat Latin 发表于 2018-05-11 | 分析:这道题是真的弱智 12345678def toGoatLatin(S): res = S.split() for i,s in enumerate(res): if s[0] in 'aeiouAEIOU': res[i] = s + 'ma' + 'a'*(i+1) else: res[i] = s[1:]+s[0] + 'ma' + 'a'*(i+1) return ' '.join(res)