The Magic of Going Back on Day 225 Today Today is day 225 of my coding journey and I focused on learning Backtracking. Backtracking is a powerful way to solve problems by using a trial and error method. It is like finding your way through a maze. If you reach a dead end you simply move back to the last path and try a different direction. The most important concept I learned is the sequence of Choose Explore and Unchoose. First you pick an option then you move forward to see if it leads to a solution. If it does not work you must undo your last step. In JavaScript we usually do this using the pop method on an array. This undo step is very important because it resets the state so we can try the next possible choice correctly. I also learned about pruning. Pruning is a way to make the code faster by stopping a path early if we know it will not lead to a valid answer. This makes backtracking much smarter than simple brute force. I practiced these concepts by solving several classic problems that require finding all possible combinations and arrangements. #DSAinJavaScript #365daysOfCoding #JavaScriptLogic #LeetCode #Backtracking #AlgorithmDesign #ProblemSolving #CodingChallenge #WebDevelopment #SoftwareEngineering #Recursion #ProgrammingDaily #LogicBuilding #TechLearning #DataStructures #CleanCode #JSAlgorithms #SoftwareDevelopment #CodingSkills #DailyCoding
Day 225: Mastering Backtracking with JavaScript
More Relevant Posts
-
🚀 Day 10 of My LeetCode Journey — Mastering Linked Lists Today’s problems: 🔹 Middle of the Linked List (LeetCode 876) 🔹 Reverse Linked List (LeetCode 206) 💡 Problem 1: Middle of the Linked List Used the classic slow & fast pointer approach: 👉 Slow moves 1 step 👉 Fast moves 2 steps 👉 When fast reaches the end → slow is at the middle 🎯 Such a simple trick, yet super powerful! 💡 Problem 2: Reverse Linked List This one is a must-know 🔥 👉 Iteratively reverse pointers 👉 Keep track of prev, current, and next 👉 Flip links step by step Also explored how this can be done using recursion 🧠 What I Learned: Two-pointer techniques are extremely useful Pointer manipulation builds real confidence in DSA Linked Lists are all about careful handling of references 🔥 Key Takeaways: Small tricks (like slow/fast pointers) can simplify problems a lot Practicing core problems like reversing a linked list is essential for interviews Understanding the logic > memorizing code Grateful for the learning journey with Namaste DSA and Akshay Saini 🚀 🙌 Day 11 loading… 💪 #LeetCode #DataStructures #Algorithms #CodingJourney #100DaysOfCode #SoftwareEngineering #Programming #InterviewPrep #JavaScript #CodingLife #TechGrowth #ProblemSolving #Developers #LearnToCode #LinkedList #ReverseLinkedList #TwoPointers #NamasteDSA
To view or add a comment, sign in
-
🚀 Day 13 of My LeetCode Journey — Refining Linked List Skills Today’s problems: 🔹 Remove Duplicates from Sorted List (LeetCode 83) 🔹 Remove Nth Node From End of List (LeetCode 19) 💡 Problem 1: Remove Duplicates from Sorted List Since the list is already sorted: 👉 Just compare current node with next node 👉 If curr.val === curr.next.val → skip the duplicate 👉 Else → move forward Simple logic, but very effective due to the sorted property! 💡 Problem 2: Remove Nth Node From End of List Solved using two approaches: ✅ Two-Pass Approach First pass → calculate length Second pass → remove (length - n) node ⏱️ Time: O(n) ✅ One-Pass Approach (Optimized) 🔥 Use two pointers (fast & slow) Move fast ahead by n steps Move both together → when fast reaches end, slow is at target 👉 This approach is cleaner and more efficient! 🧠 What I Learned: Sorted data can simplify problems significantly Two-pointer technique continues to be super useful There’s always a way to reduce passes in linked list problems 🔥 Key Takeaways: Look for patterns (sorted, reversed, etc.) Optimize from two-pass → one-pass when possible Linked Lists are all about pointer precision Big thanks to Namaste DSA and Akshay Saini 🚀 for the guidance Day 14 loading… 💪 #LeetCode #DataStructures #Algorithms #CodingJourney #100DaysOfCode #SoftwareEngineering #Programming #InterviewPrep #JavaScript #CodingLife #TechGrowth #ProblemSolving #Developers #LearnToCode #LinkedList #TwoPointers #DSA #NamasteDSA #AkshaySaini
To view or add a comment, sign in
-
🚀 Day 11 of My LeetCode Journey — Deep Dive into Linked Lists Today was all about mastering patterns in Linked Lists: 🔹 Linked List Cycle (LeetCode 141) 🔹 Palindrome Linked List (LeetCode 234) 💡 Problem 1: Linked List Cycle Tried two approaches: ✅ Using Set Store visited nodes If node already exists → cycle detected ⏱️ Time: O(n) | 📦 Space: O(n) ✅ Fast & Slow Pointer (Floyd’s Algorithm) 🔥 Slow → 1 step Fast → 2 steps If they meet → cycle exists ⏱️ Time: O(n) | 📦 Space: O(1) 👉 This approach is elegant and optimal! 💡 Problem 2: Palindrome Linked List Again explored two approaches: ✅ Convert to Array Store values in array Compare from both ends ⏱️ Time: O(n) | 📦 Space: O(n) ✅ Optimal Approach (In-place) 🔥 Find middle node Reverse second half of linked list Compare both halves ⏱️ Time: O(n) | 📦 Space: O(1) 👉 This one really tested pointer manipulation skills! 🧠 What I Learned: One problem can have multiple valid approaches Optimal solutions often reduce space complexity Linked Lists = pointer mastery + careful thinking 🔥 Key Takeaways: Always try brute force first → then optimize Fast & slow pointer is a game-changing technique In-place solutions are highly valued in interviews Big thanks to Namaste DSA and Akshay Saini 🚀 for the guidance Day 12 loading… 💪 #LeetCode #DataStructures #Algorithms #CodingJourney #100DaysOfCode #SoftwareEngineering #Programming #InterviewPrep #JavaScript #CodingLife #TechGrowth #ProblemSolving #Developers #LearnToCode #LinkedList #TwoPointers #DSA #NamasteDSA
To view or add a comment, sign in
-
🚀 A Major Update is Coming to CodeAlive (Live in 3–4 Days!) I honestly started CodeAlive as a small platform with a simple goal in mind — to let my code snippets live over the internet with support for custom sharable links. But seeing how far it has come now, evolving into a platform with so many useful and smart features for everyone, has been incredibly exciting. 🌐 CodeAlive – https://lnkd.in/gnthhf_b 👉 Also, you can click "View My Website" on my profile to visit the platform. What’s Coming Next ⏭️ CodeAlive is soon introducing: **Multi-Language Detection & Highlighting in a Single Code File** Problem: Almost every code-sharing platforms and online editors are built around one assumption: 1 File = 1 Language But real-world development is rarely that simple. Developers often share: ✅ Frontend + Backend snippets together ✅ Embedded scripts/styles ✅ Configurations with code ✅ Multi-language examples in one paste And when platforms force a single language highlight, readability suffers. With This New Update, CodeAlive Will Support ✅ Detecting multiple languages within one pasted code file ✅ Highlighting different sections based on actual context/language ✅ Making mixed-language snippets cleaner, smarter, and easier to read This has been one of the most exciting features to work on so far, and I can’t wait to share the full implementation details once it officially goes live. 📅 Expected Release: 3–4 Days Stay tuned 👀 More technical insights coming soon... #CodeAlive #BuildInPublic #Programming #SoftwareDevelopment #DeveloperTools #WebDevelopment #Python #JavaScript #StartupJourney
To view or add a comment, sign in
-
-
🚀 Day 12 of My LeetCode Journey — Linked List Patterns Getting Stronger Today’s problems: 🔹 Intersection of Two Linked Lists (LeetCode 160) 🔹 Remove Linked List Elements (LeetCode 203) 💡 Problem 1: Intersection of Two Linked Lists Explored two approaches: ✅ Brute Force Traverse headA and check every node in headB ⏱️ Time: O(m × n) ✅ Using Set Store all nodes of headB in a Set Traverse headA and check for intersection ⏱️ Time: O(m + n) | 📦 Space: O(n) 👉 Helped me understand how hashing can optimize comparisons. 💡 Problem 2: Remove Linked List Elements Solved using a Sentinel (Dummy) Node 🔥 👉 Create a dummy node before head 👉 Use prev pointer to skip unwanted nodes: prev.next = prev.next.next This approach simplifies edge cases like: Removing head node Multiple consecutive deletions 🧠 What I Learned: Sentinel nodes make linked list problems cleaner Hashing can reduce time complexity significantly Thinking in terms of nodes (not values) is key 🔥 Key Takeaways: Always look for ways to reduce nested loops Dummy nodes = lifesaver in linked list problems Practice is making pointer manipulation more intuitive Grateful for the guidance from Namaste DSA and Akshay Saini 🚀 Day 13 loading… 💪 #LeetCode #DataStructures #Algorithms #CodingJourney #100DaysOfCode #SoftwareEngineering #Programming #InterviewPrep #JavaScript #CodingLife #TechGrowth #ProblemSolving #Developers #LearnToCode #LinkedList #DSA #NamasteDSA #AkshaySaini
To view or add a comment, sign in
-
🚀 Day 24 of My Coding Journey — Power of Two Today’s problem was “Power of Two” — a simple-looking question that really highlights the beauty of bit manipulation. 🔍 What I learned: Instead of using loops or recursion, I explored how binary representation works. A power of two always has only one set bit (1) in its binary form — and that insight leads to a super efficient solution. 💡 Key trick: n & (n - 1) === 0 This removes the lowest set bit, and if the result is zero, the number is a power of two. ⚡ Takeaway: Sometimes the most optimized solutions come from understanding how data is represented internally, not just from writing more code. 📈 Progress: Day by day, I'm getting more comfortable with problem-solving patterns and thinking beyond brute force approaches. #128DaysOfCode #LeetCode #JavaScript #CodingJourney #ProblemSolving #BitManipulation
To view or add a comment, sign in
-
-
Day 19 of My Learning Journey Revisiting the Basics 🔁 Today I found myself going back to something we all use, but rarely think deeply about — Error Handling with try...catch. As developers, it’s easy to write try...catch and move on… But revisiting it reminded me — it’s not just syntax, it’s control over failure. try...catch isn’t there to hide errors. It’s there to make sure our application behaves predictably, even when things go wrong. 💭 A few things that stood out (again): Catch only what you can actually handle — don’t swallow errors blindly Overusing try...catch can make debugging harder Sometimes letting the error bubble up is the better design Pairing it with finally is underrated for cleanup logic And the most important reminder: Robust systems aren’t built by avoiding errors… They’re built by handling them intentionally. Funny how revisiting basics always brings deeper clarity than learning something new. #Day19 #JavaScript #FrontendDeveloper #ErrorHandling #CleanCode #CodingJourney #100DaysOfCode #LearnInPublic #WebDevelopment #ContinueousLearner #LearningNeverStops #SoftwareEngineering
To view or add a comment, sign in
-
🚀 Day 8 of My LeetCode Journey — Divide & Conquer Today’s problem: Sort an Array (LeetCode 912) 💡 Approach: Merge Sort (Recursive) Instead of using built-in sorting, I implemented a recursive solution using the Divide & Conquer technique. 👉 Break the array into halves 👉 Recursively sort each half 👉 Merge the sorted halves using a helper function Creating a separate merge function to combine two sorted arrays made the logic clean and modular. 🧠 What I Learned: Recursion becomes powerful when combined with Divide & Conquer Breaking problems into smaller pieces simplifies complex logic Writing helper functions improves code readability and reuse ⚡ Complexity: ⏱️ Time: O(n log n) 📦 Space: O(n) 🔥 This problem felt like a step up from basic sorting (Bubble/Selection). Understanding how efficient sorting actually works under the hood was a great experience. Thanks to Namaste DSA and Akshay Saini 🚀 for the guidance Day 9 loading… 💪 #LeetCode #DataStructures #Algorithms #CodingJourney #100DaysOfCode #SoftwareEngineering #Programming #InterviewPrep #JavaScript #CodingLife #TechGrowth #ProblemSolving #Developers #LearnToCode #MergeSort #Recursion #DivideAndConquer #NamasteDSA
To view or add a comment, sign in
-
Most CS students finish tutorials. I'm trying to finish products. Currently building a Certificate Generator a tool that eliminates the manual work of creating certificates for events, hackathons, and workshops. Still in development. Not deployed yet. But here's what the build looks like: 𝗧𝗲𝗰𝗵 𝗦𝘁𝗮𝗰𝗸: → Flask (Python) for the backend → PyMuPDF for PDF rendering → Pillow for image/signature processing → Vanilla JS for a fully custom drag-and-drop editor → CSV input for bulk generation, JSON for template config 𝗪𝗵𝗮𝘁 𝗶𝘁 𝗱𝗼𝗲𝘀: → Generate single or bulk certificates from a CSV → Live preview before PDF export → Drag-and-drop text/signature positioning → ZIP download for bulk batches → Full font, color & signature customization The hardest part wasn't the PDF generation. It was building the interactive template editor from scratch no React, no libraries, just the browser's native APIs. That constraint made me a better developer. Deployment coming soon. Will post the link when it's live. If you're building something similar or have feedback on this project, drop it below. 🚀 #Python #Flask #WebDev #BuildInPublic #CSStudent #FullStackDevelopment #ProjectBuild
To view or add a comment, sign in
-
-
Most beginners think coding is about writing more code. It’s not. It’s about writing less code that solves bigger problems. Here’s what actually levels you up → Stop copying tutorials blindly → Start breaking things on purpose → Debug like a detective, not a guesser → Build small projects… then improve them daily → Focus on logic, not just syntax The real shift happens when you go from: “I know this code works” to “I know WHY this code works” That’s when you stop being a learner… and start becoming a developer. Consistency > Motivation. Show up daily. Even 1% better counts. #WebDevelopment #JavaScript #CodingJourney #LearnToCode #Developers #Programming #TechGrowth
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