🚀 Day 14 of My LeetCode Journey — Linked List Confidence Growing Today’s problems: 🔹 Add Two Numbers (LeetCode 2) 🔹 Odd Even Linked List (LeetCode 328) 💡 Problem 1: Add Two Numbers This problem simulates addition like we do manually: 👉 Traverse both linked lists 👉 Add corresponding digits + carry 👉 Create new nodes for the result 👉 Handle remaining carry at the end 🔥 A great mix of linked list traversal + math logic 💡 Problem 2: Odd Even Linked List This one is all about rearranging nodes: 👉 Separate nodes into odd index and even index 👉 Maintain two pointers (odd & even) 👉 Finally connect odd list with even list ⚡ No extra space needed — done in-place! 🧠 What I Learned: - Handling carry properly is crucial in problems like addition - Rearranging pointers without losing references is key - Linked List problems are getting more intuitive with practice 🔥 Key Takeaways: - Break problems into smaller steps (traverse, compute, connect) - Always track pointers carefully to avoid losing nodes - Practice is making complex problems feel simpler Grateful for the learning journey with Namaste DSA and Akshay Saini 🚀 Day 15 loading… 💪 --- #LeetCode #DataStructures #Algorithms #CodingJourney #100DaysOfCode #SoftwareEngineering #Programming #InterviewPrep #JavaScript #CodingLife #TechGrowth #ProblemSolving #Developers #LearnToCode #LinkedList #DSA #NamasteDSA #AkshaySaini
LeetCode Linked List Practice: Addition and Rearrangement
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
-
Auto-commit DSA problems Even though I was solving LeetCode regularly, my GitHub stayed inactive for months. That became a problem when I applied for an internship and was asked for my GitHub profile. That’s when it hit me why not automate this? So I built a Python tool that: Detects when I submit an accepted solution → fetches the code → saves it with proper metadata → and automatically commits it to GitHub every 10 minutes. No manual effort. Just solve problems, and everything else happens in the background. Everything perfectly aligning with the tech stack I was working on: • Python (requests, subprocess, argparse, logging) • LeetCode GraphQL API + Codeforces REST API • Git + Cron This is what I love about programming if something is repetitive or annoying, you can build a system to eliminate it. Currently working smoothly with LeetCode. Codeforces integration is still a work in progress due to API limitations. If you’re grinding DSA, this might help you keep your GitHub consistent without extra effort. Repo: https://lnkd.in/gRdSuC6S edit: cron works with mac/linux, if you are using windows it will need a task scheduler setup and you are good to go (Just phase-1, I have plans to improve this project however it does the immediate work which is automating leetcode submissions. Will share progress soon) #Python #GitHub #LeetCode #DSA #BuildInPublic #Automation #Developers #TechCommunity #CodingJourney
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
-
🚀 Day 6 of My LeetCode Journey — Search Like a Pro Today was all about mastering the fundamentals of searching: 🔹 Linear Search 🔹 Binary Search (LeetCode 704) 💡 Problem 1: Linear Search The most straightforward approach: 👉 Traverse each element 👉 Compare until you find the target Simple, but important to understand its limitation: ⏱️ Time Complexity: O(n) 💡 Problem 2: Binary Search This is where things get interesting 🔥 👉 Works only on sorted arrays 👉 Divide the search space in half every step Result: ⏱️ Time Complexity: O(log n) 🚀 This problem really helped me understand how powerful optimization can be when the data is structured correctly. 🔥 Key Takeaways: Always check if the array is sorted → you might use Binary Search Optimization often comes from reducing the search space Fundamentals like searching form the base of everything in DSA Grateful for the learning journey with Namaste DSA and Akshay Saini 🚀 Day 7 coming up 💪 #LeetCode #DataStructures #Algorithms #CodingJourney #100DaysOfCode #SoftwareEngineering #Programming #InterviewPrep #JavaScript #CodingLife #TechGrowth #ProblemSolving #Developers #LearnToCode #BinarySearch #LinearSearch #NamasteDSA
To view or add a comment, sign in
-
🚀 LeetCode Daily Challenge 🔗 Problem: https://lnkd.in/g8Xgd5wx The function goes through each word in the `queries` array. For every query word, it compares it with each word in the `dictionary`. Since all words are assumed to have the same length, it performs a character-by-character comparison. For each pair of words, a counter called `unequal` tracks how many positions have different characters. The code loops through each index of the word and increases this counter whenever the characters at the same position do not match. If the number of differing characters is 2 or less at any point, it means the query word can change into that dictionary word with at most two edits. In this case, the query word is added to the result list, and the inner loop stops early, using `break` to avoid unnecessary comparisons with other dictionary words. Finally, after checking all query words, the function returns the list of valid words that meet the condition. 👉 My Solution: https://lnkd.in/gMnYvSvx If you found this breakdown helpful, feel free to ⭐ the repo or connect with me on LinkedIn 🙂🚀 #️⃣ #leetcode #cpp #dsa #coding #problemsolving #engineering #BDRM #BackendDevWithRahulMaheswari
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 20 of My DSA Journey — Cracking “Power of Two” Today I solved the classic problem: Check if a number is a power of 2 on LeetCode. 🔍 Problem Understanding Given an integer n, we need to determine whether it can be represented as: 👉 ( n = 2^x ) where ( x \ge 0 ) 💡 Brute Force Approach Keep multiplying 2 until we reach or exceed n If we hit exactly n, return true ⛔ Not efficient for large values ⚡ Optimized Approach (My Solution) Instead of multiplying, I used a smarter trick: 👉 Keep dividing the number by 2 Steps: If n <= 0 → return false While n > 1 If n % 2 != 0 → not divisible → return false Else divide n by 2 If we reach 1 → return true 🧠 Example Walkthrough Input: n = 8 8 → 4 → 2 → 1 ✅ So, it is a power of 2 Input: n = 10 10 → not divisible cleanly ❌ So, not a power of 2 ⏱ Complexity Analysis Time Complexity: O(log n) Space Complexity: O(1) 🎯 Key Learning Problems that involve repeated division or multiplication often hint toward logarithmic optimization Always think: Can I reduce the number step by step instead of building it? 🙏 Grateful for the consistency and learning every single day 📈 Small steps daily = Big growth over time #DSA #LeetCode #CodingJourney #ProblemSolving #Java #CPP #100DaysOfCode #TechGrowth #Consistency
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
-
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