Length of Last Word
int length_of_last_word(const string& s) {
if(s.empty()) return 0;
int N = s.size();
int i = N-1;
while(i >= 0 && s[i] == ' ') i--;
if(i < 0) return 0;
int end = i;
while(i >= 0 && is_letter(s[i])) i--;
return end - i;
}