LeetCode 678 - Valid Parenthesis String - Medium
Автор: Learn with EmKay
Загружено: 2024-04-07
Просмотров: 73
#leetcode #leetcodedailychallenge #leetcodesolution #leetcodesolutions
=====
If you enjoy my explanations, please recommend my channel to your friends. I would appreciate that.
=====
Stack or DP? That is the question.
Time complexity of the stack approach: O(n) because of the for loop
Space complexity of the stack approach: O(n) because of the stacks
Time complexity of the DP approach: O(n^2) because of the number of the subproblems, each subproblem takes O(1) to update
Space complexity of the DP approach: O(n^2) because of the dp table
0:00 Discuss the stack solution
10:42 Write code for the stack solution
16:40 Discuss the DP solution
25:30 Write code for the DP solution
Problem statement:
https://leetcode.com/problems/valid-p...
Доступные форматы для скачивания:
Скачать видео mp4
-
Информация по загрузке: