Im getting wrong output for Redundant parantheses
can u tell me where am i going wrong?
Im getting wrong output for Redundant parantheses
can u tell me where am i going wrong?
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
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.