sentence: words separated by exactly one space. A word is any non-empty run of characters without spaces.
Reverse each word on its own, keeping the order of the words and the spaces between them. Return the resulting string.sentence='Keep it simple' → 'peeK ti elpmis'
Each word is read backwards while the word order stays: peeK ti elpmis.
sentence='2 + 2 = 4' → '2 + 2 = 4'
Every "word" here is a single character, so the string is unchanged.
sentence="don't-stop" → "pots-t'nod"
There are no spaces, so it is one word, reversed as a whole along with the apostrophe and the dash: pots-t'nod.
sentence.length ≤ 5 · 10⁴sentence consists of printable ASCII characterssentence='Keep it simple'
'peeK ti elpmis'
Run checks the first 3 tests in your browser. Submit checks all 86 tests on the server, hidden ones included.