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
Combination Sum II: Backtracking Strategy
More Relevant Posts
-
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 9 of My DSA Learning Journey – Linked List Practice Today’s session was a continuation of Linked Lists, where we focused on solving practical problems to strengthen our understanding of linked list operations and algorithms. 📌 Problems Practiced ✔ Finding the index of an element in a linked list ✔ Finding the last index of an element ✔ Calculating the size of a linked list ✔ Finding the middle element ✔ Detecting loops in a linked list 🧠 Algorithm Learned – Floyd’s Cycle Detection (Tortoise & Hare) One of the most interesting concepts today was Floyd’s Cycle Detection Algorithm, used to detect loops in a linked list. ⚙ How it works: • Two pointers traverse the list at different speeds • Slow pointer (tortoise) → moves one step • Fast pointer (hare) → moves two steps • If a loop exists, both pointers eventually meet at the same node 🔹 Additional Practice We also revised problems related to array rearrangement, which helped strengthen our array manipulation and logical thinking. 💡 Key Takeaway Consistent practice in Data Structures & Algorithms is improving my problem-solving ability and coding confidence every day. 🙏 Special thanks to Ms. Poovizhi, Trainer at TAP Academy, for the clear explanations and continuous guidance. #DSA #LinkedList #Algorithms #ProblemSolving #CodingJourney #Java #LearningEveryday #TAPAcademy
To view or add a comment, sign in
-
-
💡 LeetCode Practice – Increasing Triplet Subsequence Today I learned that not every problem can be solved using sorting. Maintaining the original order and thinking in terms of traversal is crucial. 📌 Key Learning: Importance of index order (i < j < k) Optimizing from brute force to O(n) Smart tracking instead of extra space Consistency is building confidence 🚀 #leetcode #codingjourney #webdevelopment #dsa
To view or add a comment, sign in
-
-
Day 3 | LeetCode Learning Journal 🚀 Today I solved Combination Sum (Problem 39) on LeetCode another powerful backtracking problem. Compared to N-Queens, this one focused more on exploring combinations systematically while avoiding unnecessary paths. The interesting part was that we can reuse the same element multiple times, which changes how we design the recursive calls. The key learning was understanding how to: Keep track of the remaining target Use a start index to avoid duplicate combinations. Backtrack properly by removing the last added element after recursion .Instead of generating all possibilities blindly, I learned how pruning works if the current sum exceeds the target, we immediately stop exploring that path. This makes the solution much more efficient. 💡 🌱 What I learned: • How to generate combinations using recursion • Importance of pruning in backtracking • Managing state with push and pop operations • Thinking in terms of decision trees #LeetCode #100DaysOfCode #CodingJourney #Backtracking #DSA #Day3
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
-
-
Following tutorials can often feel like you're making fake progress. You follow the steps, the code works, and everything looks great, until you try to change one small thing and it all breaks. The hardest part of programming isn't learning a new language; it's realizing that watching someone else solve a problem isn't the same as solving it yourself. To actually grow, I’ve learned you have to embrace the frustration. Instead of chasing a perfect project, focus on building small, messy versions of your ideas. If you don’t understand a line of code you just wrote, delete it and try again. Real understanding comes when you stop looking for the happy path and start asking why things break. If your learning feels slow and a bit painful, you're probably doing it right. Build the hard things, finish the imperfect projects, and don't be afraid to start over from scratch. That’s where the real skill is built. #Technology #SoftwareEngineering #PersonalDevelopment #ProgrammingTips #WebDevelopment #GenZ #BuildinPublic
To view or add a comment, sign in
-
-
🚀 Continuing My Data Structures & Algorithms Learning Journey at TAP Academy 📚 Today’s session at TAP Academy was focused on understanding the fundamentals of Recursion, guided by my trainer Poovizhi VP. It was an insightful session that helped me strengthen my understanding of how recursive logic works in programming. 🔍 Key Concepts I Explored Today 🔹 Recursion Fundamentals Learned how a function can call itself and why defining a proper base condition is crucial to prevent infinite execution. 🔹 Role of Stack Memory Understood how recursive calls are managed in the call stack, and how improper recursion can lead to stack overflow. 🔹 Hands-on Recursive Programs Implemented classic problems like Factorial and the Fibonacci series using recursive logic. 🔹 Problem Solving with Recursion Practiced solving problems such as the sum of the first N natural numbers and generating number sequences using recursion. 🔹 Visualizing Recursive Flow Analyzed recursion trees and stack execution to clearly understand how each function call returns its result. ☺️ Grateful to TAP Academy for the structured training and a special thanks to Poovizhi VP for explaining complex topics in such a clear and practical way. 📈 Every session is taking me one step closer to becoming a better programmer. #DSA #Recursion #Java #Programming #LearningJourney #TAPAcademy #ProblemSolving #TechSkills
To view or add a comment, sign in
-
-
🚀 Day 11/30 🗓30days30problems journey 💡Today’s practice session gave me an important insight about the power of dry run while solving problems. 📚While working on problems ranging from Binary Search (Medium level) to String-based questions, I realized that doing a proper dry run makes a huge difference in understanding the logic and memorizing the pattern. 📥Instead of jumping directly into coding, tracing the algorithm step-by-step on paper or in mind helps to: ✔️ Understand the problem clearly ✔️ Avoid silly mistakes ✔️ Remember the approach for longer time ✔️ Improve problem-solving speed 📌Dry run is not just for beginners — it is a habit that makes complex problems look simple. Every day in this 30days30problems journey, I’m learning that consistency + clear thinking > rushing to code. Looking forward to Day 12 🔥 #LeetCode #30daysofCode #ProblemSolving #DSA #CodingJourney #BinarySearch #Strings #LearningInPublic #30Days30Problems #SDE #SWE #Technology
To view or add a comment, sign in
-
-
💡 Learning Data Structures & Algorithms one problem at a time. I’ve recently started focusing more on DSA and problem solving using LeetCode, and to keep myself consistent I decided to document my learning journey publicly on GitHub. In this repository, I’ll be uploading the LeetCode problems I solve along with their solutions as I continue learning and improving my problem-solving skills. The goal is simple: ✔ Stay consistent ✔ Strengthen my DSA fundamentals ✔ Track my progress over time You can check out my repository here: 🔗 https://lnkd.in/gA7qkb5e If you’re also learning DSA or preparing for coding interviews, feel free to connect or share your tips! #DSA #LeetCode #Programming #CodingJourney #GitHub #LearningInPublic #SoftwareDevelopment
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