Dsa
Stack
Medium
String Reversal with Operators
Create a program that reads a string and reverses the order of characters, but characters enclosed within parentheses '()' must remain in their original order. The program outputs the new string format.
Example:
Input:
abc(def)ghi
Output:
ihg(def)cba
Key concepts
stackstring manipulation
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now