Tap here to switch tabs
Problem
Submissions

Problem: Reverse Only Letters

med
30 min
Try to solve the Reverse Only Letters problem.

Statement

Given a string s, reverse all English letters in the string such that all characters that are not English letters remain in their original positions, while all English letters are reversed.

Return the resulting string.

Constraints:

  • 1≤1 \leq s.length ≤100\leq 100

  • s consists of characters with ASCII values in the range [33,122][33, 122].

  • s does not contain '\\"' or '\\\'.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Reverse Only Letters

med
30 min
Try to solve the Reverse Only Letters problem.

Statement

Given a string s, reverse all English letters in the string such that all characters that are not English letters remain in their original positions, while all English letters are reversed.

Return the resulting string.

Constraints:

  • 1≤1 \leq s.length ≤100\leq 100

  • s consists of characters with ASCII values in the range [33,122][33, 122].

  • s does not contain '\\"' or '\\\'.