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
LeetCode Challenge: Frog Jump Problem Solution with Dynamic Programming
More Relevant Posts
-
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 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 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 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
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 9/60 — LeetCode Discipline Problem Solved: Container With Most Water (Revision) Difficulty: Medium Today’s session focused on revisiting this classic two-pointer optimization problem. The key insight was understanding how intelligently moving pointers can reduce time complexity while still exploring the optimal solution space. 💡 Focus Areas: • Strengthened two-pointer optimization technique • Improved area maximization intuition • Practiced greedy pointer movement logic • Focused on writing clean and efficient implementation ⚡ Performance Highlight: Achieved ~81% runtime efficiency on submission. Steady practice. Sharper instincts. Stronger foundations. #LeetCode #60DaysOfCode #100DaysOfCode #DSA #TwoPointers #Greedy #Algorithms #DataStructures #ProblemSolving #CodingJourney #SoftwareEngineering #TechCareers #Programming #Developers #CodingLife
To view or add a comment, sign in
-
-
🚀 Day 19 | 100 Days of Coding Challenge #DrGViswanathanChallenge 📘 Problem Solved: Combination Sum III 🔧 Approach Used (Backtracking): • Generated combinations using numbers 1–9 • Ensured each number is used only once • Maintained a running sum and current combination • If the sum becomes 0 and the combination size equals k, we store the result • Used backtracking (Choose → Explore → Undo) to explore all valid possibilities ⏳ Complexity: Time: O(2⁹) (since numbers are from 1–9) Space: O(k) recursion stack 🧠 Key Learning: Backtracking is powerful for generating combinations with constraints like fixed size (k) and target sum (n). Using a starting index (last) ensures elements are not reused and avoids duplicate combinations. 📂 Topics Covered: Backtracking, Recursion, Combinations, Constraint-based Search #100DaysOfCode #DSA #LeetCode #CPP #CodingJourney #Backtracking #CompetitiveProgramming
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
-
-
🚀 Day 18 | 100 Days of Coding Challenge #DrGViswanathanChallenge 📘 Problem Solved: Subsets II (LeetCode) 🔧 Approach Used (Backtracking + Sorting): • Sorted the array to handle duplicates • Generated subsets recursively • Skipped duplicate elements at the same recursion level • Used backtracking (Do → Explore → Undo) ⏳ Complexity: Time: O(2ⁿ) Space: O(n) (recursion stack) 🧠 Key Learning: Handling duplicates correctly is crucial in subset generation problems. Sorting + smart skipping avoids repeated subsets efficiently. 📂 Topics Covered: Backtracking, Recursion, Arrays, Power Set #100DaysOfCode #DSA #CPP #LeetCode #CodingJourney #CompetitiveProgramming
To view or add a comment, sign in
-
-
🚀 Day 17/60 — LeetCode Discipline Problem Solved: 4Sum (Revision) Difficulty: Medium Today’s session revisited the classic k-Sum family problem — 4Sum. After solving 2Sum and 3Sum patterns previously, this problem naturally extends the idea by combining sorting with nested iteration and the two-pointer technique to efficiently identify unique quadruplets. The key challenge lies in managing duplicates carefully while keeping the solution efficient and structured. 💡 Focus Areas: • Strengthened k-Sum pattern understanding • Practiced sorting + two-pointer combination • Improved duplicate handling in multi-pointer problems • Reinforced nested iteration optimization • Focused on writing structured and readable code Problems like these highlight how mastering one pattern allows you to scale the same idea to more complex variations. #LeetCode #60DaysOfCode #100DaysOfCode #DSA #TwoPointers #Arrays #Algorithms #DataStructures #ProblemSolving #CodingJourney #SoftwareEngineering #Programming #Developers #TechCareers
To view or add a comment, sign in
-
Explore related topics
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