deno.land / x / masx200_leetcode_test@10.6.5 / goat-latin / index.ts

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
export default function toGoatLatin(sentence: string): string { return sentence .split(" ") .map((v, i) => { if (unordered_set.has(v[0])) { v = v + "ma"; } else { v = v.slice(1) + v[0] + "ma"; } return v + "a".repeat(i + 1); }) .join(" ");}const unordered_set = new Set([ "a", "e", "i", "o", "u", "A", "E", "I", "O", "U",]);
masx200_leetcode_test

Version Info

Tagged at
a year ago