Skip to content

Commit 8fd0ffa

Browse files
authored
Merge pull request #1949 from laitooo/0058-length-of-last-word.dart
Create: 0058-Length-Of-Last-Word.dart
2 parents 3f05d31 + 639367e commit 8fd0ffa

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Diff for: dart/0058-length-of-last-word.dart

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
class Solution {
2+
int lengthOfLastWord(String s) {
3+
final words = s.trim().split(" ");
4+
return words[words.length - 1].length;
5+
}
6+
}

0 commit comments

Comments
 (0)