Day 3 LeetCode Practice: Palindrome Number & Regex Matching

Day 3 | DSA + LeetCode Practice 🚀 Continuing my #100DaysOfCode challenge with a focus on understanding problem-solving patterns and thinking step by step. ✅ Problems Solved Today: Leetcode #9 🔹Palindrome Number Problem: Given an integer x, determine whether it is a palindrome. • Methodology Applied: Mathematical reasoning / Two-pointer logic • Approach: Avoided converting the number into a string Reversed half of the number mathematically Compared the reversed half with the remaining part 📌 Key Learning: Breaking the problem into smaller logical steps helps eliminate unnecessary conversions and leads to a more optimized solution. Leetcode #10 🔹 Regular Expression Matching • Methodology Applied: Dynamic Programming • Approach: Used a DP table where dp[i][j] represents whether the first i characters of string s match the first j characters of pattern p Handled two special cases carefully: → matches any single character → matches zero or more of the preceding element Built the solution bottom-up by considering all valid transitions 📌 Key Learning: Once the DP logic is clear, the solution becomes systematic. 📌 Day 3 Takeaway: Easy problems test clarity. Moving to Day 4 🔁 #Day3 #100DaysOfCode #LeetCode #DSA #ProblemSolving #CPlusPlus #BuildInPublic #DynamicProgramming #LearningInPublic 🚀

To view or add a comment, sign in

Explore content categories