Question
reverseAll should take a String and return a String All substrings inside matching parentheses should be reversed. If the reversed portion contains matching parentheses, these
reverseAll should take a String and return a String All substrings inside matching parentheses should be reversed. If the reversed portion contains matching parentheses, these should be "re-reversed" and so on. The parentheses should still be correctly matched and nested about the different affected substrings. reverseAll("a b (c d e (f g) (h (i j k l (m n o) (p q)) r s t)) (u v w) x y z") should return "a b ((h ((p q) (m n o) l k j i) r s t) (f g) e d c) (w v u) x y z"
You are allowed to use the following from the Java API:
class String
length
charAt
class StringBuilder
length
charAt
append
toString
class Character
any method
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started