QUANTIL interview question

Database questions validating parenthesis coding task