Getting wrong answers in some input

Getting Yes for all inputs…
example – (() , ((( , etc.
the link of my code :

there can be other braces like ‘[’ or ‘{’ except ‘(’ please account for them as well

code for reference purpose: