Atome interview question

easy Leet code question to check valid parenthesis