Intuitive interview question

It was the valid parenthesis problem on a stack