Length of Last Word at Microsoft

Easy58.3% acceptance

This problem has 37.5% frequency at Microsoft.

Problem Description

Given a string `s` consisting of words and spaces, return _the length of the**last** word in the string._ A **word** is a maximal substring consisting of non-space characters only.

Read full problem and hints

Topics

Also asked at 7 companies


More Microsoft Questions

View all Microsoft questions