Freshworks interview question

Write a program for paranthesis matching