Name: Length of Last Word
Difficulty: Easy
Description: Find the length of the last word
Example:
Input: s = " fly me to the moon " Output: 4 Explanation: The last word is "moon" with length 4.
int lengthOfLastWord(string s) {
auto i = s.end() - 1;
while(*i == ' ') --i;
auto j = i - 1;
while (j >= s.begin() && *j != ' ') --j;
return i - j;
}