LTM Limited interview question

Balanced paranthesis coding problem from leetcode