text. Reverse the order of its English letters (lowercase and uppercase), while every other character, such as digits, punctuation and dashes, stays exactly where it was.
In other words, if you read off just the letters of the result, they spell the original letters backwards, and each non-letter keeps its position. Return the resulting string.text='no-3-way' → 'ya-3-won'
The letters n o w a y read backwards are y a w o n and fill the letter slots, while the dashes and the 3 stay put: ya-3-won.
text='Hi!Bob?' → 'bo!BiH?'
The letters H i B o b reversed are b o B i H; the ! and ? keep their positions: bo!BiH?.
text='7+8=15' → '7+8=15'
There are no letters at all, so the string is unchanged.
text.length ≤ 100text consists of printable ASCII characters (codes 32 to 126)text='no-3-way'
'ya-3-won'
Run checks the first 3 tests in your browser. Submit checks all 100 tests on the server, hidden ones included.