Redundant parantheses


Im getting wrong output for Redundant parantheses

can u tell me where am i going wrong?

hi @apoorv.chauhann can you copy paste the question description here

Given a string of balanced expression, find if it contains a redundant parenthesis or not. A set of parenthesis are redundant if same sub-expression is surrounded by unnecessary or multiple brackets. Print β€˜Yes’ if redundant else β€˜No’.

Note: Expression may contain β€˜+β€˜, β€˜*β€˜, β€˜β€“β€˜ and β€˜/β€˜ operators. Given expression is valid and there are no white spaces present.

Example:

Input: ((a+b)) (a+(b)/c) (a+b*(c-d)) Output: Yes Yes No

@apoorv.chauhann print answer for each test case in a different line

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.