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 0614029 commit 4cc479eCopy full SHA for 4cc479e
2018.12.3-leetcode58/Avalon.md
@@ -0,0 +1,8 @@
1
+class Solution {
2
+ public int lengthOfLastWord(String s) {
3
+ String[] sArr = s.trim().split(" ");
4
+ if (sArr.length == 0)
5
+ return 0;
6
+ return sArr[sArr.length-1].length();
7
+ }
8
+}
0 commit comments