Redundant Braces

Write a program to validate if the input string has redundant braces?
Return 0/1

0 -> NO
1 -> YES

Input will be always a valid expression

and operators allowed are only + , * , - , /


((a + b)) has redundant braces so answer will be 1
(a + (a + b)) doesn't have have any redundant braces so answer will be 0

NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified. Still have a doubt? Checkout Sample Codes for more details.
Start solving Redundant Braces on Interview Code Editor
Sign Up
to access hints and editorial solutions for Redundant Braces
Asked In:


Click here to start solving coding interview questions