Tap here to switch tabs
Problem
Submissions

Problem: Reverse Letters Then Special Characters in a String

med
30 min
Try to solve the Reverse Letters Then Special Characters in a String problem.

Statement

You are given a string s.

Perform the following operations in order:
11. Reverse all the lowercase English letters while preserving the relative positions of the special characters.
22. Reverse all the special characters while preserving the relative positions of the lowercase English letters.

Return the modified string after applying both operations.

Constraints:

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

  • s consists only of lowercase English letters and the special characters in "!@#$%^&*()".

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Reverse Letters Then Special Characters in a String

med
30 min
Try to solve the Reverse Letters Then Special Characters in a String problem.

Statement

You are given a string s.

Perform the following operations in order:
11. Reverse all the lowercase English letters while preserving the relative positions of the special characters.
22. Reverse all the special characters while preserving the relative positions of the lowercase English letters.

Return the modified string after applying both operations.

Constraints:

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

  • s consists only of lowercase English letters and the special characters in "!@#$%^&*()".