Skip to content

Commit

Permalink
solution: 0058. Length of Last Word
Browse files Browse the repository at this point in the history
  • Loading branch information
flynnpark committed Jan 29, 2024
1 parent cf01b01 commit 5af174f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/0058/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
function lengthOfLastWord(s: string): number {}
function lengthOfLastWord(s: string): number {
return s.trimEnd().split(' ').pop()?.length ?? 0;
}

export { lengthOfLastWord };

0 comments on commit 5af174f

Please sign in to comment.