Regular Expression Matching - 2 || DP 23 || Placement Preparation Series || Hard || LeetCode 10 ||

preview_player
Показать описание
For better experience watch at 1.25x
Here, in this video we have discussed the choice approach followed by DP for Regular Expression Matching . Hope You Will Like it . Open for your suggestions for improvement always!

For jumping to any particular section use the following time stamps:
00:00 Video Intro
01:30 Question Explanation
08:00 Choices discussion for recursive Brute-Force
20:30 Writing the Recursive Code!
27:30 Debugging some silly mistakes
30:30 Memoizing the Recursive Code!
32:30 Video Outro!

📢📢 Our complete Placement Preparation Series [PPS] :-

=============================================================================

=============================================================================

Link to our other major series:-

=============================================================================
#Leetcode #GeeksForGeeks #Microsoft #Adobe #Amazon #flipkart #MicrosoftInterviewQuestion #WordBogglerGFG
#Oracle #InterviewBit #InterviewQuestion #Google #Codenation #BinarySearch
#Stl #LeetCode_Medium #Implementation #Optimization #fastest_solution #MostAskedQuestion #super_tricky #C++ #BestExplanation #backtracking
#DP_For_beginners
#From_where_to_start_Dynamic_Programming
#How_to_identify_a_problem_is_of_Dynamic_Programming
#How_to_understand_Dynamic_Programming
#Microsoft_Interview_Question
#Google_Interview_Question
#Adobe_Interview_Question
#GFGEasy #Dynamic_Programming_Series
#DynamicProgramming
#DpForBeginners
#RecursionTreeExplained
#LIS
#Minimum_number_of_deletions_to_make_a_sorted_sequence
#RepeatingSubsequence #InterviewBit #RegularExpressionMatching
#RegularExpressionMatchingLeetCode #RegularExpressionMatchingInterviewBit #LeetCode10 #interviewBitsRegex2
Regular Expression Matching - 2 || DP 23 || Placement Preparation Series || Hard || LeetCode 10 ||
Regular Expression Matching - 2 || DP 23 || Placement Preparation Series || Hard || LeetCode 10 ||
Regular Expression Matching - 2 || DP 23 || Placement Preparation Series || Hard || LeetCode 10 ||
Regular Expression Matching - 2 || DP 23 || Placement Preparation Series || Hard || LeetCode 10 ||
Regular Expression Matching - 2 || DP 23 || Placement Preparation Series || Hard || LeetCode 10 ||
Regular Expression Matching - 2 || DP 23 || Placement Preparation Series || Hard || LeetCode 10 ||
Regular Expression Matching - 2 || DP 23 || Placement Preparation Series || Hard || LeetCode 10 ||
Regular Expression Matching - 2 || DP 23 || Placement Preparation Series || Hard || LeetCode 10 ||
Regular Expression Matching - 2 || DP 23 || Placement Preparation Series || Hard || LeetCode 10 ||
Regular Expression Matching - 2 || DP 23 || Placement Preparation Series || Hard || LeetCode 10 ||
Regular Expression Matching - 2 || DP 23 || Placement Preparation Series || Hard || LeetCode 10 ||
Regular Expression Matching - 2 || DP 23 || Placement Preparation Series || Hard || LeetCode 10 ||
Regular Expression Matching - 2 || DP 23 || Placement Preparation Series || Hard || LeetCode 10 ||
Regular Expression Matching - 2 || DP 23 || Placement Preparation Series || Hard || LeetCode 10 ||
Regular Expression Matching - 2 || DP 23 || Placement Preparation Series || Hard || LeetCode 10 ||
Regular Expression Matching - 2 || DP 23 || Placement Preparation Series || Hard || LeetCode 10 ||
Regular Expression Matching - 2 || DP 23 || Placement Preparation Series || Hard || LeetCode 10 ||
Regular Expression Matching - 2 || DP 23 || Placement Preparation Series || Hard || LeetCode 10 ||
Regular Expression Matching - 2 || DP 23 || Placement Preparation Series || Hard || LeetCode 10 ||
Regular Expression Matching - 2 || DP 23 || Placement Preparation Series || Hard || LeetCode 10 ||
Regular Expression Matching - 2 || DP 23 || Placement Preparation Series || Hard || LeetCode 10 ||
Рекомендации по теме
Комментарии
Автор

int Solution::isMatch(const string s, const string p) {
bool dp[s.size()+1][p.size()+1];
dp[0][0]=true;
int start=1;
while(start<=p.size() && p[start-1]=='*')
dp[0][start]=true, start++;
for(int i=start;i<=p.size();i++)
dp[0][start]=false;
for(int j=1;j<=s.size();j++)
dp[j][0]=false;
for(int i=1;i<=s.size();i++)
{
for(int j=1;j<=p.size();j++)
{
if(s[i-1]==p[j-1] || p[j-1]=='?')
dp[i][j]=dp[i-1][j-1];
else if(p[j-1]=='*')
dp[i][j]=dp[i-1][j] | dp[i][j-1];
else
dp[i][j]=false;
}
}

return dp[s.size()][p.size()];

}

BroCoders
Автор

This is very very hard, still didn't understand it fully, neither the previous regexp.

as_a_tester