Problem
Given a string s, reverse only the English letters (a–z and A–Z) and return the result. Every character that is not a letter stays at the same index.
Example 1
- Input
- s = "ab-cd"
- Output
- "dc-ba"
Example 2
- Input
- s = "a-bC-dEf-ghIj"
- Output
- "j-Ih-gfE-dCba"
Example 3
- Input
- s = "Test1ng-Leet=code-Q!"
- Output
- "Qedo1ct-eeLg=ntse-T!"
Constraints
1 <= s.length <= 100s consists of ASCII characters with codes from 33 to 122.s contains no double quotes or backslashes.