deno.land / x / masx200_leetcode_test@10.6.5 / check-if-string-is-a-prefix-of-array / index.ts

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
export default function isPrefixString(s: string, words: string[]): boolean { for (const word of words) { if (s.startsWith(word)) { s = s.slice(word.length); if (s.length === 0) return true; } else { return false; } } return false;}
masx200_leetcode_test

Version Info

Tagged at
a year ago