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 0614029 + 4cc479e commit 1fd3015Copy full SHA for 1fd3015
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