Regular Expression Matching | Brute Force | Optimal | Recursion Concepts And Questions
iPad PDF Notes - https://github.com/MAZHARMIK/Interview_DS_Algo/blob/master/iPad%20PDF%20Notes/Leetcode-10-Regular%20Expression-Matching-Recursion%20Concepts%20%26%20Qns%20-%2018.pdf
Whatsapp Community Link : https://www.whatsapp.com/channel/0029Va6kVSjICVfiVdsHgi1A
This is the 18th video of our playlist "Recursion Concepts And Questions". Find the Details below :
Video Name : Regular Expression Matching | Brute Force | Optimal | Recursion Concepts And Questions
Video # : 18
C++/Java Code Link : https://github.com/MAZHARMIK/Interview_DS_Algo/blob/master/Recursion/Regular%20Expression%20Matching.cpp
Leetcode Link : https://leetcode.com/problems/regular-expression-matching/
NOTE : We will also optimise the code by memoization (DP)
๐ Unraveling Recursion: A Journey into the Depths of Code
๐ฅ Welcome to the 18th Video of my Recursion Playlist! ๐ In this enlightening video, we will solve another very famous recursion problem "Regular Expression Matching". We will start with a Simple story as well as Tree Diagram for understanding the problem and then we will be Converting Story to code and writing the recursive code for the problem and I will also be explaining the Time and Space Complexity of the code ๐.
๐ What's Inside?
๐ Simple story understanding with Tree Diagram
๐ Converting Story to code and writing the recursive code for Regular Expression Matching problem
๐ Explanation of Time and Space Complexity of the code
๐ฉโ๐ป Who Should Watch?
This playlist is for everyone but best suited for Freshers who are new to Recursion.
๐ Embark on the Recursive Adventure Now!
My DP Concepts Playlist : https://youtu.be/7eLMOE1jnls
My Graph Concepts Playlist : https://youtu.be/5JGiZnr6B5w
My GitHub Repo for interview preparation : https://github.com/MAZHARMIK/Interview_DS_Algo
Subscribe to my channel : https://www.youtube.com/@codestorywithMIK
Instagram : https://www.instagram.com/codestorywithmik/
Facebook : https://www.facebook.com/people/codestorywithmik/100090524295846/
Twitter : https://twitter.com/CSwithMIK
Approach Summary :
Approach-1 -
The solution uses recursion to check if a given text matches a pattern with wildcard characters '' and '.'. It handles base cases, matches the first character, and deals with '' by exploring two possibilities. The time complexity is exponential, and the space complexity is O(m), where m is the length of the pattern. While correct, this approach may benefit from optimization techniques for better efficiency.
Approach-2 -
In this approach, we will use i and j pointers in order to avoid substring call multiple times and we also memoize the code for optimal solution.
โโโฆโโโฆโโโโฆโโฆโฆโฆโฆโโโโ
โโโฃโโโโโฃโโฃโโฃโโฃโโโฃโโฃ
โ โโโโโโโ โโโโฃโโโโโโโฃ
โโโฉโโโฉโโฉโโฉโโฉโโโฉโโฉโโ
โจ Timelinesโจ
00:00 - Introduction
04:08 - Though process from examples
25:13 - Tree Diagram
31:07 - Story To Code
38:42 - Time & Space Complexity
41:22 - Coding Story To Code
46:51 - Optimisation
48:39 - Coding Optimal Approach
#codestorywithMIK
#coding #helpajobseeker #easyrecipes #leetcode #leetcodequestionandanswers #leetcodesolution #leetcodedailychallenge #leetcodequestions #leetcodechallenge #hindi #india #coding #helpajobseeker #easyrecipes #leetcode #leetcodequestionandanswers #leetcodesolution #leetcodedailychallenge #leetcodequestions #leetcodechallenge #hindi #india #hindiexplanation #hindiexplained #easyexplaination #interview#interviewtips #interviewpreparation #interview_ds_algo #hinglish #github #design #data #google #video #instagram #facebook #leetcode #computerscience #leetcodesolutions #leetcodequestionandanswers #code #learning #dsalgo #dsa #2024 #newyear #RecursionExplained #CodingJourney #Programming101 #TechTalks #AlgorithmMastery #Recursion #Programming #Algorithm #Code #ComputerScience #SoftwareDevelopment #CodingTips #RecursiveFunctions #TechExplained #ProgrammingConcepts #CodeTutorial #LearnToCode #TechEducation #DeveloperCommunity #RecursiveThinking #ProgrammingLogic #ProblemSolving #AlgorithmDesign #CSEducation