Search⌘ K
AI Features

Length of Last Word

Try to solve the Length of Last Word problem.

We'll cover the following...

Statement

Given a string s made up of English letters and space characters, return the length of the last word in s. A word is a maximal contiguous sequence of English letters. Trailing spaces in s should not be considered part of the last word.

Note: s is guaranteed to contain at least one word.

Constraints:

  • ...