@@ -0,0 +1,669 @@
+// Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string.%0A%0A// If the last word does not exist, return 0.%0A%0A// Note: A word is defined as a character sequence consists of non-space characters only.%0A%0A// For example, %0A// Given s = %22Hello World%22,%0A// return 5.%0A%0Apublic class Solution %7B%0A    public int lengthOfLastWord(String s) %7B%0A    %09int len = 0;%0A%09%09for(int i = s.length() - 1; i %3E 0; i--)%7B%0A%09%09%09if(s.charAt(i) != ' ')%7B%0A%09%09%09%09len = 1;%0A%09%09%09%09for(int j = i - 1; j %3E= 0; j--)%7B%0A%09%09%09%09%09if(s.charAt(j) != ' ')%7B%0A%09%09%09%09%09%09len++;%0A%09%09%09%09%09%7Delse%7B%0A%09%09%09%09%09%09break;%0A%09%09%09%09%09%7D%0A%09%09%09%09%7D%0A%09%09%09%09break;%0A%09%09%09%7D%0A%09%09%7D%0A%09%09return len;       %0A    %7D%0A%7D

add length of last word solution