Expedia Group interview question

Write a program to accept well-bracketed sequences of characters.