Leetcode #678 - Valid Parenthesis String

preview_player
Показать описание
This video contains a detailed explanation of how to solve Leetcode #678 which is "Valid Parenthesis String." It also contains the code for the solution in C++.

The problem statement is as follows:
Given a string containing only three types of characters: '(', ')' and '*', write a function to check whether this string is valid. We define the validity of a string by these rules:
1. Any left parenthesis '(' must have a corresponding right parenthesis ')'.
2. Any right parenthesis ')' must have a corresponding left parenthesis '('.
3. Left parenthesis '(' must go before the corresponding right parenthesis ')'.
4. '*' could be treated as a single right parenthesis ')' or a single left parenthesis '(' or an empty string.
5. An empty string is also valid.

If you enjoyed the video, please don't forget to like, comment, and subscribe!

Arushi Gupta | AlgoSTEM
Рекомендации по теме
Комментарии
Автор

Thanks for explaining the concept at 5:55, wasnt able to figure out this edge case for a long time. Subscribed!

amogchandrashekar
Автор

those voice overs were hilarious for some reason. Great video

billybest
welcome to shbcf.ru