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.
1 parent e14b2c3 commit 836eb38Copy full SHA for 836eb38
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