Length of Last Word

Given a string containing words and spaces, return the length of the last word. A word is a maximal sequence of non-space characters.

Examples
Input: "Hello World"
Output: 5
Hints

Length of Last Word

Given a string containing words and spaces, return the length of the last word. A word is a maximal sequence of non-space characters.