Рет қаралды 52,782
This video explains a very important stack interview coding problem which is to find if a given string is valid or invalid in terms of parenthesis. This question is slightly twisted because it has stars in it as well which can be converted to ( or ) or and empty string. I have explained the solution using two stacks which is one of the optimal solution running in linear time O(N). As usual, CODE LINK is given below. If you find any difficulty or have any query then do COMMENT below. PLEASE help our channel by SUBSCRIBING and LIKE our video if you found it helpful...CYA :)
CODE LINK: gist.github.co...