@@ -0,0 +1,660 @@
+/***%0A * 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        if (s.length() == 0)%0A            return 0;%0A        s = s.trim();%0A        for (int i = s.length(); i %3E 0; i--)%7B%0A            if (s.charAt(i - 1) == ' ')%0A                return s.length() - i;%0A        %7D%0A        return s.length();%0A    %7D%0A%7D%0A

add LengthofLastWord.java