Day 17 | LeetCode Learning Journal 🚀 Today’s focus: Problem 125: Valid Palindrome. Moving from frequency counting (Day 12) to the Two-Pointer technique has been a game-changer. It’s fascinating how shifting from "how many characters do I have?" to "where are my pointers meeting?" optimizes both space and time complexity. The real challenge today wasn't just the logic, but handling the "noise"—filtering out non-alphanumeric characters and managing case sensitivity. It's a great reminder that real-world data is rarely clean, and our code needs to be resilient. 17 days in. The problems are getting more nuanced, but the process is becoming second nature. #LeetCode #100DaysOfCode #CodingJourney #ProblemSolving #CPlusPlus #DSA #LearningInPublic #KeepGrowing
Valid Palindrome Problem Solution with Two-Pointer Technique
More Relevant Posts
-
Day 18 | LeetCode Learning Journal 🚀 Today I tackled Problem 403: Frog Jump, and this one really pushed me to think beyond simple linear logic. Moving from the string manipulation of yesterday to a Hard-level Dynamic Programming problem was a significant leap. It’s fascinating how a problem that seems like a simple pathfinding task actually requires deep insights into state management. I learned that sometimes you don't just need to know where you are, but also the "momentum" (the jump size) that got you there. Key takeaways from today: State Representation: Realized the necessity of a 2D state or a map of sets to track both the stone position and the last jump distance. Memoization is King: Saw firsthand how storing computed paths prevents the exponential time complexity that would otherwise crash the solution. Resilience: Hard problems can be intimidating, but breaking them down into small, logical sub-problems makes them manageable. #LeetCode #100DaysOfCode #CodingJourney #ProblemSolving #CPlusPlus #DSA #LearningInPublic #DynamicProgramming #KeepGrowing
To view or add a comment, sign in
-
-
Day 24 | LeetCode Learning Journal 🚀 Today was all about tackling Problem 47: Permutations II, and it was a masterclass in the art of Backtracking. While the first permutations problem is about exploring possibilities, this one adds a layer of complexity: handling duplicates. It’s fascinating how a small constraint—like ensuring each permutation is unique—completely changes the strategy. It forced me to think deeply about state management and how to use sorting and conditional checks to "prune" the search tree, preventing redundant calculations. Key Takeaways from Today: Pruning is Power: Learning when not to explore a path is just as important as knowing how to traverse one. The Power of Recursion: Breaking down a complex combinatorial problem into smaller, repeatable logic steps is where the magic happens. #LeetCode #100DaysOfCode #CodingJourney #ProblemSolving #CPlusPlus #DSA #Backtracking #LearningInPublic #KeepGrowing
To view or add a comment, sign in
-
-
Day 79 | #100DaysOfCode | #100DaysOfLearning 🧿 Still diving deeper into the Binary Tree pattern ✅ Solved: Symmetric Tree (Leetcode 101) This problem checks whether a binary tree is a mirror of itself around its center. 💡 Key Idea: Instead of comparing nodes in the same direction, we compare them crosswise: Left subtree of node A ↔ Right subtree of node B Right subtree of node A ↔ Left subtree of node B If both sides match at every level → the tree is symmetric. Approach (Recursion): If both nodes are NULL → symmetric If one is NULL → not symmetric Values must match Recursively compare: left.left with right.right left.right with right.left 📌 This problem strengthened my understanding of: ✔️ Mirror recursion in trees ✔️ Comparing two structures simultaneously ✔️ Thinking about trees from two directions at once Consistency continues… 79 days of showing up and learning something new. #100DaysOfCode #DSA #BinaryTree #Leetcode #CodingJourney #ProblemSolving #SoftwareEngineering #TechCommunity #Programmers #Developers #LearnInPublic
To view or add a comment, sign in
-
-
Day 20 | LeetCode Learning Journal 🚀 Today was all about Problem 63: Unique Paths II. Moving from simple pathfinding to navigating a grid filled with obstacles really highlights the beauty of Dynamic Programming. It’s about turning a complex, branching tree of possibilities into a clean, efficient, iterative solution. What I learned today: Handling Constraints: Adding obstacles isn't just a minor tweak; it changes how you initialize your DP table and handle edge cases. Optimal Substructure: The number of ways to reach grid[i][j] is simply the sum of ways from the top and the left—provided the path isn't blocked. Efficiency Matters: Seeing that 0ms runtime (Beats 100%) is the ultimate "aha!" moment. It proves that clean logic and space optimization (like using a 1D DP array) pay off. 20 days in, and the logic is starting to feel like second nature. The problems are getting tougher, but the clarity is getting sharper. Consistency truly is the bridge between confusion and mastery. Onward to Day 21! 🧱🏃♂️ #LeetCode #100DaysOfCode #CodingJourney #DynamicProgramming #CPlusPlus #DSA #LearningInPublic #Consistency #SoftwareEngineerin
To view or add a comment, sign in
-
-
Day 27 | LeetCode Learning Journal 🚀 Today I tackled Problem 40: Combination Sum II, and this one was a masterclass in the art of Backtracking. While Day 12 taught me the power of frequency mapping, today was all about managing state and avoiding duplicates. It’s fascinating how adding a single constraint—using each number only once—completely changes the strategy. It’s not just about finding a path to the target; it’s about efficiently pruning the search tree so you don't waste time on redundant calculations. Key takeaways from today: Sorting is Strategy: Sorting the input initially makes it much easier to skip duplicate elements during recursion. Pruning for Performance: Learning when to stop the recursion (if current > target) is the difference between a TLE (Time Limit Exceeded) and a 0ms runtime! 27 days in, and the "backtracking" mindset is finally starting to click. Seeing that 0ms (Beats 100%) result feels incredible—it's proof that clean logic beats brute force every time. #LeetCode #100DaysOfCode #CodingJourney #ProblemSolving #CPlusPlus #DSA #Backtracking #LearningInPublic #KeepGrowing
To view or add a comment, sign in
-
-
Day 25 | LeetCode Learning Journal 🚀 Today I tackled the classic N-Queens problem. If Day 12 was about patterns and counting, today was all about Backtracking and visualizing the recursion tree. Key Takeaways: Backtracking is Art: It’s not just about trying every possibility; it’s about "pruning" the branches that don't work early on to save time. The isSafe Logic: Writing a clean helper function to check rows, columns, and diagonals is the heart of this problem. It really tests your ability to think spatially in a grid. Debugging Recursion: Seeing that "Accepted" green text for a Hard/Medium-Hard backtracking problem hits different. It’s a sign that my ability to trace complex code is sharpening. "Consistency matters more than perfection." 25 days down—a quarter of the way through the 100-day mark! The problems are getting tougher, but the logic is becoming more intuitive. Excited to keep pushing deeper into advanced algorithms. #LeetCode #100DaysOfCode #CodingJourney #ProblemSolving #CPlusPlus #DSA #Backtracking #NQueens #LearningInPublic #KeepGrowing
To view or add a comment, sign in
-
-
🚀 LeetCode Daily Challenge – Prime Number of Set Bits 📌 Problem: 762. Prime Number of Set Bits in Binary Representation 🔗 LeetCode Daily Question Today’s problem was simple on the surface—but a neat mix of bit manipulation + math. We’re given a range [left, right], and the task is to count numbers whose number of set bits (1s in binary) is prime. Brute force counting? Works—but needs optimization mindset. 💡 Key Insight: Use built-in bit count (popcount) to count set bits efficiently. Then check if that count belongs to a small set of prime numbers. Since max bits ≤ 20 → primes are limited → pre-store them. 🛠 Approach: • Loop from left → right • Count set bits using __builtin_popcount • Check if count is prime (using set lookup) • Increment answer ⏱ Complexity: Time: O(n) Space: O(1) ✔ Accepted ✔ Clean and efficient ✔ Bit manipulation reinforced Takeaway: Sometimes constraints quietly simplify the problem—spot them early. Practicing DSA daily with LeetCode, learning alongside CoderArmy, and guided by Rohit Negi. Consistency compounds. 🚀 #Day25/90 #LeetCode #DSA #BitManipulation #Math #ProblemSolving #CPlusPlus #LearningInPublic #ProblemSolving2026
To view or add a comment, sign in
-
-
Day 28 | LeetCode Learning Journal 🚀 Today I tackled Problem 37: Sudoku Solver, and this one was a true test of patience and algorithmic thinking. Moving from simple patterns to complex backtracking has been a game-changer. It’s fascinating how recursion allows us to explore thousands of possibilities, "pruning" the ones that don't work and pivoting until we find the perfect solution. It’s not just about writing code; it’s about teaching the program how to make decisions. Key takeaways from today: Backtracking Mastery: Understanding how to "undo" a choice is as important as making one. Validation Logic: Breaking down constraints (rows, columns, and 3x3 grids) into clean, reusable functions. #LeetCode #100DaysOfCode #CodingJourney #ProblemSolving #CPlusPlus #DSA #Backtracking #LearningInPublic #KeepGrowing
To view or add a comment, sign in
-
-
Day 2 | LeetCode Learning Journal 🚀 Today I worked on N-Queens (Problem 51) on LeetCode another classic backtracking problem. After solving Sudoku on Day 1, I felt more prepared, but N-Queens had its own twist. The biggest challenge was managing diagonal attacks efficiently. Learning that row - col and row + col can uniquely track diagonals was a game-changing moment. 💡 Instead of checking the entire board every time, I used separate arrays for columns and diagonals to keep the solution optimized and clean. This really improved my understanding of how to structure recursive calls properly. 🌱 What I learned: • Backtracking works best with smart state management • Clean validation reduces time complexity • Confidence grows when you tackle hard problems consistently #LeetCode #100DaysOfCode #CodingJourney #Backtracking #DSA #Day2
To view or add a comment, sign in
-
-
🚀 Day 21 | 100 Days of Coding Challenge #DrGViswanathanChallenge 📘 Problem Solved: Word Search (LeetCode) 🔧 Approach Used (Backtracking + DFS): • Traversed each cell of the grid as a potential starting point • Used DFS to explore adjacent cells (up, down, left, right) • Marked visited cells temporarily to avoid reuse • Applied backtracking to restore the cell after exploring paths 📌 Key Idea: If the current character matches the target word index, continue searching its neighbors until the whole word is found. ⏳ Complexity: Time: O(m × n × 4ᴸ) (L = length of the word) Space: O(L) recursion stack 🧠 Key Learning: Grid-based problems often combine DFS with backtracking. Marking visited cells temporarily helps prevent revisiting the same cell during a search path. 📂 Topics Covered: Backtracking, DFS, Matrix Traversal #100DaysOfCode #DSA #LeetCode #CPP #CodingJourney #Backtracking #CompetitiveProgramming
To view or add a comment, sign in
-
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development