Search
⌘K

Leetcode 58. Length of Last Word

Given a string of letters and spaces, return the length of its last word (a maximal non-space substring). Account for possible trailing spaces by locating the final token rather than splitting naively.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.