Tap here to switch tabs
Problem
Submissions

Problem: Reverse Only Letters

Reverse Only Letters asks you to return a string with its English letters in reverse order, while every non-letter character stays in its original position.

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

Reverse Only Letters asks you to return a string with its English letters in reverse order, while every non-letter character stays in its original position.

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 '\\\'.