Solved LeetCode #10: Regular Expression Matching with Recursion

📅 Day 36 of #100DaysOfCode Today’s challenge was one of the most interesting and tricky recursion problems! Problem: Regular Expression Matching (LeetCode #10) 🔍 Approach: The goal is to determine if a given string text matches a pattern that includes: . → Matches any single character * → Matches zero or more occurrences of the preceding element 1️⃣ Used recursion to check character-by-character matches. 2️⃣ For each step: Checked if the current characters match (text[0] == pattern[0] or pattern[0] == '.'). If the next pattern character is *, explored two possibilities: Skip * and the previous character (zero occurrence). Use * to match one or more occurrences (consume one character from text). 3️⃣ Continued recursively until the entire text and pattern were checked. #100DaysOfCode #LeetCode #DSA #ProblemSolving #Cplusplus #CodingChallenge #Algorithms #Programming #DeveloperLife #CodeNewbie #DailyDSA #SoftwareEngineering #CodingJourney #LearningInPublic #TechCommunity #KeepLearning #Recursion #GrowthMindset #Motivation

  • text

To view or add a comment, sign in

Explore content categories