Day 51 of My 90-Day Coding Challenge Today’s focus was on recursion, and honestly — it’s not as simple as it looks. I solved Letter Combinations of a Phone Number, which seems straightforward at first, but quickly tests how well you actually understand recursive thinking. The real challenge wasn’t writing code — it was thinking in terms of: • Breaking the problem into smaller subproblems • Building combinations step by step • Managing the recursive flow correctly Key learning: Recursion is not about memorizing patterns — it’s about visualizing the decision tree and trusting the process. One mistake I noticed: If you don’t clearly understand the base case and transitions, recursion becomes confusing very fast. What improved today: • Better clarity on how combinations are formed • Stronger grip on recursion structure (index + choices) • More confidence in handling backtracking-style problems Hard truth: Recursion feels difficult because the thinking is different — not because the problem is hard. And that’s exactly why it’s important to master it. #90DaysOfCode #DSA #Java #Recursion #Backtracking #LeetCode #ProblemSolving
Mastering Recursion in 90-Day Coding Challenge
More Relevant Posts
-
Day 60 of My 90-Day Coding Challenge Today I worked on a classic recursion + backtracking problem — and it really tested how well I understand breaking problems into smaller decisions. At first, it feels messy: multiple partitions, multiple choices, and many possible paths. But once you start thinking in terms of: -“Try every possible cut and validate it” the structure becomes clear. Key learning: • Recursion is about exploring all paths, not rushing to the answer • Validity checks (like palindrome here) are what control the tree • Clean backtracking (add → recurse → remove) is everything One thing that really helped today: Even if you don’t know where to start, just begin drawing the recursion tree. As you expand it step by step, the logic starts revealing itself — what choices to make, when to stop, and how to backtrack. What stood out today: Clarity in recursion doesn’t come from memorizing patterns — it comes from visualizing the process. Still improving. #90DaysOfCode #DSA #Java #Recursion #Backtracking #LeetCode #ProblemSolving
To view or add a comment, sign in
-
-
Day 55 of 100 Days of LeetCode 💻 Today I solved Longest Consecutive Sequence — and honestly, this one taught me more about coding discipline than algorithms. At first, my approach was correct: Used HashSet for O(1) lookup Applied the “start of sequence” logic But I still got TLE. The reason? A tiny mistake: if(!set.contains(num-1)); That single ; made my condition useless and turned my O(n) solution into O(n²). 💡 Lesson learned: Don’t just think your logic is right → verify what your code actually does Small syntax mistakes can completely break optimal solutions Debugging is just as important as problem-solving Finally fixed it and got Accepted ✅ Slowly improving not just in DSA, but in writing cleaner and more careful code. #100DaysOfLeetCode #DSA #Java #CodingJourney #Learning
To view or add a comment, sign in
-
-
Day 58 of My 90-Day Coding Challenge Today was a step back toward real problem solving. Worked on a problem that required Fast Exponentiation (Binary Exponentiation) — not something you can brute force your way through. Key learning: • When constraints are large, O(n) thinking fails • You must reduce the problem using logarithmic approaches • Repeated squaring is not just an optimization — it’s the only viable way Instead of multiplying step by step, the idea is to: • Square the base • Halve the exponent • Build the answer conditionally This reduces time complexity from O(n) → O(log n). What stood out today: Recognizing when a problem is actually about math + patterns, not loops. Back to building momentum. #90DaysOfCode #DSA #Java #BinaryExponentiation #ProblemSolving #LeetCode #Optimization
To view or add a comment, sign in
-
-
🚀 Day 6 of LeetCode Problem Solving Solved today’s problem — LeetCode #1480: Running Sum of 1d Array 💻🔥 ✅ Approach: Prefix Sum (Running Sum) ⚡ Time Complexity: O(n) 📊 Space Complexity: O(n) The task was to compute the running sum of an array where each element represents the sum of all previous elements including itself. 👉 Example: Input: [1,2,3,4] Output: [1,3,6,10] 💡 Key Idea: Keep adding elements as you traverse the array and store the cumulative sum. 👉 Core Logic: Initialize sum = 0 Traverse array Add current element → sum += nums[i] Store in result array 💡 Key Learning: Simple problems help build strong fundamentals — mastering basics like prefix sum is very important for advanced problems. Grateful to my mentor Pulkit Aggarwal — your guidance is helping me strengthen my fundamentals every day 🙌 Consistency is the key — small steps lead to big results 🚀 #Day6 #LeetCode #DSA #Java #CodingJourney #ProblemSolving #100DaysOfCode
To view or add a comment, sign in
-
-
🚀 Day 8 of 30 Days Coding Challenge Today I solved a problem on LeetCode: Minimum Distance Between Three Equal Elements. 🔍 Approach: Initially implemented a brute-force solution using three nested loops (O(n³)). It worked for smaller constraints but highlighted the importance of optimizing. 💡 Key Learning: Instead of checking all possible triplets, grouping indices of identical elements and analyzing consecutive occurrences leads to a much more efficient solution. ⚡ Optimization Insight: Reduced time complexity from O(n³) → O(n) Leveraged HashMap to store indices and process only relevant combinations. 📈 Takeaway: This problem reinforced an important concept: 👉 When dealing with repeated elements, think in terms of grouping and patterns rather than brute force. Consistency is key — learning something new every day and improving step by step. #Day8 #30DaysOfCode #CodingChallenge #LeetCode #Java #DataStructures #Algorithms #ProblemSolving #CodingJourney #SoftwareDevelopment #LearnToCode #TechGrowth
To view or add a comment, sign in
-
-
At first, the Rotate Image problem looked tricky. Rotating a matrix in-place isn’t something that feels obvious right away. But after thinking about it, I realized it’s not about rotation directly, it’s about transforming the matrix step by step. By first flipping it across the diagonal (transpose) and then reversing each row, the rotation happens naturally. Moments like this remind me that in coding, the right approach often matters more than the problem itself. Learning to break problems down is the real skill. RAVI KUMAR Coding Blocks Sunstone #Coding #DSA #Java #ProblemSolving #GrowthMindset #Learning
To view or add a comment, sign in
-
-
Day 63 of Practicing DSA (LeetCode && Competitive Programming) Today’s progress: LeetCode • Longest Common Prefix – Easy Focused on: • Sorting-based approach for string comparison • Comparing first and last strings to find common prefix • Understanding optimization in string problems • Writing clean and concise logic This problem improved my understanding of efficient string handling techniques. Competitive Programming • Continued practicing problem-solving patterns Improved my thinking on: • Breaking down string problems logically • Writing optimized and readable code Simple problem, but strong fundamentals matter 💯 Consistency is the real key 🔥 #DSA #Java #LeetCode #Codeforces #Strings #ProblemSolving #Consistency #LearningInPublic 🚀
To view or add a comment, sign in
-
-
🚀 Day 13/100 – LeetCode Journey 📌 Problem: Rotate Array (LeetCode 189) Today’s problem looked simple at first… but it taught me something deeper about how arrays and math work together. 🔹 Task: Rotate an array to the right by k steps. Example: [1,2,3,4,5,6,7], k = 3 → [5,6,7,1,2,3,4] --- 💡 Key Learning: Instead of shifting elements again and again (which is inefficient), I learned a smarter way using: 👉 "(i + k) % n" This single formula helped me: - Move elements to the correct position - Avoid index out-of-bounds - Understand how modulo (%) creates a circular effect --- 🧠 Biggest takeaway: At first, I struggled with: 👉 Why "3 % 7 = 3" 👉 Why we don’t use decimals in modulo Now it finally makes sense: ✔ Modulo gives the remainder after full division ✔ It helps wrap values within array limits ✔ Arrays can be treated like a circle 🔄 --- 💻 Approach Used: - Extra array to store rotated values - Place each element using "(i + k) % n" - Copy back to original array --- ✨ What I realized: Sometimes the problem isn’t coding… It’s understanding the math behind it. --- #Day13 #100DaysOfCode #LeetCode #Java #DSA #CodingJourney #ProblemSolving
To view or add a comment, sign in
-
-
Day-3 of My Coding Journey Today I worked on the LeetCode problem: 👉 Find Numbers with Even Number of Digits What I learned: How to count digits in a number using String.valueOf(num).length() How to check if a number has even digits using % 2 == 0 ❌ My Mistake: I wrote: String.value(num).length % 2 == 0 ✔ Issues: Used value() instead of valueOf() Forgot () in length ✅ Fix: String.valueOf(num).length() % 2 == 0 After correcting this, my solution got Accepted! ✨ Takeaway: Small syntax mistakes can cause errors, but fixing them improves attention to detail and strengthens fundamentals. #Day3 #LeetCode #Java #CodingJourney #Learning 10000 Coders
To view or add a comment, sign in
-
-
🚀100 Days of Code Day-20 LeetCode Practice – Valid Parentheses Today, I solved the "Valid Parentheses" problem, which is a great example of using the Stack data structure effectively. 🔍 Problem Summary: Given a string containing brackets ()[]{}, the task is to check whether the brackets are valid based on correct order and matching pairs. 💡 Approach: I used a Stack to keep track of opening brackets and ensured each closing bracket matches the most recent opening one. ⚡ Key Learnings: Understanding how LIFO (Last In First Out) works in real problems Importance of handling edge cases like empty stack Writing clean and optimized logic using data structures 📌 Consistency in problem-solving is helping me strengthen my DSA skills step by step! #LeetCode #DSA #Java #ProblemSolving #CodingJourney #Stack #Learning
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