Search
⌘K

Leetcode 557. Reverse Words in a String III

Reverse the characters of each word in a sentence while preserving the original word order and spaces. Words are non-empty and separated by a single space (no leading/trailing spaces), with total length up to about 5×10^4.

Asked at:

Meta


Question Timeline

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

Early January, 2025

Meta

Mid-level

input = [ "H", "e", "l", "l", "o", " ", "M", "e", "t", "a"] output = "olleH ateM". input = [ "H", "e", "l", "l", "o","M", "e", "t", "a"] output = "ateMolleH"

Comments

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