Wrong test case given

According to gfg both the test cases i.e
(((a+(b))+(c+d))) and
((a+(b))+(c+d))
should return yes and according to cb the last one is returning no so pls help in understanding the situation and identify error in my code
link for gfg:-https://www.geeksforgeeks.org/expression-contains-redundant-bracket-not/
my code:-https://ide.codingblocks.com/s/339420

https://ide.codingblocks.com/s/339421 this is my code

hello @kunal81198
answer of both the test case should be yes.

image

include alphabets as well

If i include alphabets then ((b) +a) would become correct

yeah it is correct…

(a) -> valid case no redundant brackets
((a)) -> here we have one redundant bracket

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.