Its a interview question. I have not been able to get any optimal solution.
Can someone share the logic and code for this. (preferably in Java)
e.g : ((ab)+c) should become ab+c.
My logic is Parenthesis are redundant if at least one of the operators has lower precedence than an operator attached directly to the parenthesized expression on either side of it.
But I could not reach to final code.
Can someone help…??
Thanks in Advance…!!