Check balanced brackets, braces, parenthesis

Posted on

One of the famous interview question asked is to check if the given string has proper completion of string. This question is twisted and asked in various way, either check for brackets or any one of the bracket, braces or parenthesis or all.

Lets see an example to understand how this can be achieved.

Output

Str1 is Incorrect string
Str2 is Correct string

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.