this code gives correct output for ((a+(b))+(c+d))
but in the sample test case it is given as not duplicate
but it contains duplicate parenthesis around character b
Redundant parenthesis
How u say that b has duplicate characters? Elaborate.
b is surrounded by parentheses, if we remove parenthesis it doesnt affect, after removal expression will be ((a+b)+(c+d))
I think u get the question wrong. The question is to remove repeated paranthesis. For example in the second case it would have contain duplicates if the expression would be ((a+((b))+(c+d))
what i got is, agar kisi expression se parenthesis remove karte hai to expression ke evaluation par koi farak nahi padta, agar koi expression aisa parenthesis contain karta hai to use duplicate kehte hai, jaise is example ((a+(b))+(c+d)) me b ke aspas parenthisis hai, and pura expression bhi parenthesis ke ander hai, ye dono parenthesis ke remove karne par expression evaluation par koi farak nahi padta hai