Question d’entretien chez Revvity

how to solve the valid parenthesis problem