最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

leetcode 824. Goat Latin

2021-05-10 16:54 作者:您是打尖兒還是住店呢  | 我要投稿

A sentence?S?is given, composed of words separated by spaces. Each word consists of lowercase and uppercase letters only.

We would like to convert the sentence to "Goat Latin"?(a made-up language similar to Pig Latin.)

The rules of Goat Latin are as follows:

  • If a word begins with a vowel (a, e, i, o, or u), append?"ma"?to the end of the word.
    For example, the word 'apple' becomes 'applema'.
    ?

  • If a word begins with a consonant (i.e. not a vowel), remove the first letter and append it to the end, then add?"ma".
    For example, the word?"goat"?becomes?"oatgma".
    ?

  • Add one letter?'a'?to the end of each word per its word index in the sentence, starting with 1.
    For example,?the first word gets?"a"?added to the end, the second word gets?"aa"?added to the end and so on.

Return the?final sentence representing the conversion from?S?to Goat?Latin.?



難得開心的一天,在病痛的折磨下;

leetcode 824. Goat Latin的評論 (共 條)

分享到微博請遵守國家法律
云霄县| 罗定市| 南雄市| 花垣县| 松滋市| 凤冈县| 内丘县| 黑龙江省| 上高县| 庆城县| 雷波县| 庐江县| 蓬溪县| 滕州市| 象州县| 南宫市| 佛学| 兴和县| 石狮市| 蒲江县| 获嘉县| 贵港市| 东明县| 岐山县| 博爱县| 梁河县| 北宁市| 丰顺县| 噶尔县| 兖州市| 华安县| 大余县| 饶河县| 左云县| 竹山县| 大竹县| 宁晋县| 清徐县| 怀远县| 济南市| 左云县|