Ankit152 / CPP-STL

A repository to understand C++ STL and use it in coding interviews and coding contests.
6 stars 13 forks source link

Parenthesis Checker #30

Closed Ankit152 closed 3 years ago

Ankit152 commented 3 years ago

Given an expression string x. Examine whether the pairs and the orders of “{“,”}”,”(“,”)”,”[“,”]” are correct in exp. For example, the function should return 'true' for exp = “[()]{}{[()()]()}” and 'false' for exp = “[(])”.

Input: {([])} Output: true

debanjan-2002 commented 3 years ago

Hi, Please assign this issue to me. I will solve this in O(n) using stack data structure. @Ankit152

Regards, Debanjan Poddar