Traverse from end to the first whitespace character and count the number of letters. Return the count as our pointer hits the whitespace character.
//T: O(N^2*M) where N is the length of the word, M is total no. of words //S: O(N^2*M) where N is the length of the word, M is total no. of words ...