So I'm currently working on a complex calculator app and I have been stuck on this issue for a while now,
Problem: I want to create a hook that would return true if an opening parenthesis has corresponding closing parentheses, also the parenthesis should only close when the last character is not an opening parenthesis (i.e there has to be a value in between them, which would be a number).
Attempt: I have tried using the stack algorithm, but it doesn't seem to give me what I want.