Length Of Last Word Leetcode Solution Java