Balanced Brackets|| stacks|| CPP || do subscribe || do like ||

Published: 31 August 2022
on channel: code it
26
2

from a given string of having parenthesis determining is it a valid parenthesis or not !

Sample Input::
----- --------
3 n = 3
{[()]} first s = '{[()]}'
{[(])} second s = '{[(])}'
{{[[(())]]}} third s ='{{[[(())]]}}'

Sample Output:

YES
NO
YES

Explanation
The string {[()]} meets both criteria for being a balanced string.
The string {[(])} is not balanced because the brackets enclosed by the matched pair { and } are not balanced: [(]).
The string {{[[(())]]}} meets both criteria for being a balanced string.


On this page of the site you can watch the video online Balanced Brackets|| stacks|| CPP || do subscribe || do like || with a duration of hours minute second in good quality, which was uploaded by the user code it 31 August 2022, share the link with friends and acquaintances, this video has already been watched 26 times on youtube and it was liked by 2 viewers. Enjoy your viewing!