deno.land / x / masx200_leetcode_test@10.6.5 / length-of-last-word / index.ts

نووسراو ببینە
1
2
3
4
5
6
7
8
9
export default function lengthOfLastWord(s: string): number { const arr = s.split(/\s+/g); if (arr.at(-1)?.length === 0) arr.pop(); //console.log(arr) const result = arr.at(-1)?.length;
return result || 0;}
masx200_leetcode_test

Version Info

Tagged at
a year ago