Search⌘ K
AI Features

Solution: Length of Last Word

C# solution for the Length of Last Word problem using the Two Pointers pattern.

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:

  • 11 \leq ...