We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 9980e77 + 836eb38 commit c9e483dCopy full SHA for c9e483d
2018.12.3-leetcode58/湛江甲鸟.md
@@ -0,0 +1,9 @@
1
+```
2
+public int lengthOfLastWord(String s) {
3
+ if (s == null || s.length() == 0){
4
+ return 0;
5
+ }
6
+ String[] strs = s.split(" ");
7
+ int last = strs.length - 1;
8
+ return strs[last].length();
9
+}
0 commit comments