Redundant parenthesis

How to approach this question.
Please Just give a small hint don’t give full algorithm

We iterate through the given expression and for each character in the expression, if the character is a open parenthesis β€˜(β€˜ or any of the operators or operands, we push it to the stack. If the character is close parenthesis β€˜)’, then pop characters from the stack till matching open parenthesis β€˜(β€˜ is found.
Now for redundancy two condition will arise while popping-

  1. If immediate pop hits a open parenthesis β€˜(β€˜, then we have found a duplicate parenthesis. For example, (((a+b))+c) has duplicate brackets around a+b. When we reach second β€œ)” after a+b, we have β€œ((” in the stack. Since the top of stack is a opening bracket, we conclude that there are duplicate brackets.

  2. If immediate pop doesn’t hit any operand(β€˜*’, β€˜+’, β€˜/’, β€˜-β€˜) then it indicates the presence of unwanted brackets surrounded by expression. For instance, (a)+b contain unwanted () around a thus it is redundant.