Duo Security interview question

Write a function to check for valid brackets