🚀 Day-77 of #100DaysOfCodeChallenge Today’s problem: Delete Nodes From Linked List Present in Array (LeetCode 3217) 💻 Working with linked lists always reminds me that sometimes in code — and in life — you have to remove what’s not needed to keep things moving efficiently ✂️ This challenge was about filtering out nodes whose values existed in a given array — a perfect mix of logic, pointer manipulation, and careful iteration 🔁 ✨ What I learned today: Efficiently handling deletions in a linked list without breaking the chain Using hash sets to make lookups faster on LeetCode. The importance of clean and minimal traversal logic Some problems aren’t just about syntax — they’re about clarity of thought 🧠 Another green check ✅ Another step closer to consistency 💪 #100DaysOfCode #LeetCode #ProblemSolving #CodingJourney #DataStructures #Algorithms #LinkedList #DeveloperLife #CodeEveryday #JavaDeveloper #TechJourney
Deleted nodes from linked list using hash sets on LeetCode
More Relevant Posts
-
🚀 Day 12 — LeetCode #49: Group Anagrams I solved #LeetCode49 using a hash map with a character-count key (O(N·K) time). Instead of sorting each string, I used a fixed 26-length tuple of character counts as the dictionary key — faster when strings get long. 💡 Solution idea: For each word create a 26-entry count tuple and group words with the same tuple. 🧩 Challenge for you: Which approach would you pick and why? A — Sort each string (simple & intuitive) B — Character-count tuple (O(N·K), great for long words) C — Other (prime-hash, multiset, language-specific tricks) — share below! Drop your choice in the comments and paste your implementation (or a one-liner)! I'll feature interesting takes and explain trade-offs. #100DaysOfCode #DataStructures #Algorithms #C++ #LeetCode
To view or add a comment, sign in
-
-
💻 Day 47 of #50DaysOfLeetCode Challenge 🚀 Problem: Binary Tree Maximum Path Sum (Leetcode 124) The goal was to find the maximum path sum in a binary tree — where the path can start and end at any node, not just the root. 🌲 🧠 Approach: I solved it using postorder traversal (Left → Right → Root). At every node, I calculated: 1️⃣ bothpaths → path passing through root (left + right + root) 2️⃣ bestpath → best path going downward from root (max of left or right + root) 3️⃣ onlyroot → when only the root node is part of the path At each step, I updated a global maxsum with the best of these three values. This way, every node contributed the maximum possible sum considering all cases. 🧩 Key Takeaway: 👉 Always think in terms of "What value should I return to parent?" vs "What value should I update globally?" 👉 Binary tree recursion becomes intuitive once you separate these two thoughts.
To view or add a comment, sign in
-
-
🚀 Day 407 of #365DaysOfCode 🎯 Problem: 3321. Find X-Sum of All K-Long Subarrays II 🧩 Difficulty: Hard Today’s challenge took the concept of frequency-based subarray analysis to the next level 🔥 Given an array and two integers k and x, the goal is to compute the X-Sum for every subarray of length k. The X-Sum is calculated by taking the sum of occurrences of the top X most frequent elements in the subarray (with ties broken by larger element value). 💡 Key Idea: Since n can go up to 10⁵, we can’t recompute everything for each subarray. We use a sliding window approach with a HashMap for frequency tracking — efficiently adding and removing elements as the window moves — and compute the X-Sum dynamically. 💻 Approach: 1️⃣ Maintain frequency counts using a HashMap. 2️⃣ Sort by frequency (and value when tied). 3️⃣ Use a sliding window to efficiently update counts instead of recalculating each time. 4️⃣ Compute and store the X-Sum for each window. 📊 Complexity: O(n × log(k)) 🧠 Concepts Used: Sliding Window | HashMap | Greedy Sorting Every hard problem is a reminder that optimization isn’t just about speed — it’s about thinking smart and coding cleaner. 💪 #LeetCode #Java #ProblemSolving #CodingChallenge #Algorithms #DataStructures #100DaysOfCode #365DaysOfCode #SlidingWindow #HashMap
To view or add a comment, sign in
-
-
🚀 Just Completed a Deep Dive into Claude Code Here are my biggest takeaways: 💡 Smart Context Management Claude uses three-layer CLAUDE.md files (machine / project / local) to keep the right context at the right time — nothing more, nothing less. ⚙️ Plan Mode vs Thinking Mode Plan Mode → breadth: multi-step tasks across the codebase Thinking Mode → depth: complex logic and debugging Knowing when to use each is a real game-changer. 🔍 Hooks for Code Quality Automatic TypeScript or Python checks and duplicate code detection run after every edit — it’s like having a senior engineer reviewing changes in real time. 🧩 Extensibility MCP servers (like Playwright) and GitHub integration (e.g. @mentions in PRs) open up powerful automation workflows I’m still exploring. #AI #DeveloperTools #SoftwareEngineering #ClaudeCode #Productivity
To view or add a comment, sign in
-
Day 5/365 — Tackling Linked Lists & Recursion 🚀 Another milestone on my LeetCode journey! Today, I solved five classic problems that deepened my understanding of linked lists and recursion. Problems Solved Today: 21. Merge Two Sorted Lists 22. Generate Parentheses 23. Merge k Sorted Lists 24. Swap Nodes in Pairs 25. Reverse Nodes in k-Group Today's Stats: 🕒 Time spent: about 3 hours 🧠 Concepts used: linked list manipulation, dummy nodes, recursion, divide and conquer, iterative/pointer techniques ✨ Biggest insight: Attacking complex list problems with both recursion and iterative logic—and using dummy nodes—makes tricky edge cases much easier to handle. 3 Tips Learned: 1. Using a dummy node can simplify pointer management for list merges. 2. Break down recursive problems like parentheses/gen. into base case + valid subparts. 3. For k-group reversal, visualize node connections before coding to avoid pointer mishaps. Why this challenge? Every new pattern mastered compounds into long-term algorithmic confidence. Let's keep grinding! Are you on a similar journey? Drop a 👍 if you're committed too, and share your favorite coding tip! #LeetCode #365DaysOfCode #Algorithms #DataStructures #ProgrammingJourney #ProblemSolving #GrowthMindset #LearningInPublic #DeveloperLife
To view or add a comment, sign in
-
🌟 #Day4 of #100DaysCodingChallenge 🌟 Problem: Count Elements With Maximum Frequency Platform: LeetCode 🧠 Problem Summary: Given an array of integers, the goal is to find how many elements appear with the maximum frequency. For example, if the array is [1, 2, 2, 3, 3], both 2 and 3 appear twice — the maximum frequency — so the output is 4 (because 2 and 3 each appear twice). ⚙️ Key Concepts: HashMap / Frequency map in C++ Counting occurrences efficiently Using loops and conditions to find max frequency 🎯 Goal of the Day: ✔ Strengthen problem-solving with maps ✔ Practice frequency-based questions ✔ Build confidence with array + hash map problems 🚀 Learning Never Stops! #Day4 #100DaysOfCode #LeetCode #CPP #ProblemSolving #WomenInTech #CodingJourney
To view or add a comment, sign in
-
-
💻 LeetCode Post — Day 3 of Week 2 #Learning_Of_DSA 🚀 Today’s #LeetCode_Problem_1 – Two Sum 💡 Today’s problem reminded me — simple logic can solve powerful challenges. The task? Given an array, find two numbers that add up to a target. At first glance, it looks easy — but efficiency matters when data grows big. ⚡ 🧠 Approach: Used a HashMap to store previously seen numbers and their indices. For every element, checked if (target - current) already exists in the map — if yes, we found our pair! Time complexity: O(n) — lightning-fast compared to the brute force O(n²). 💬 Takeaway: Problem-solving isn’t about memorizing patterns — it’s about thinking logically, efficiently, and scalably. Every question is another step toward writing code that thinks before it runs. 🚀 #LeetCode #DSA #LearnInPublic #ProblemSolving #CodingJourney #100DaysOfCode #SoftwareEngineering #MERNStack #CareerGrowth #TechWithPurpose
To view or add a comment, sign in
-
-
🚀Day 77 of #120_Days_leetCode Challenge ! LeetCode Problem: Find and Replace Pattern Today’s problem was all about pattern matching with bijective mappings — where we find words that match a given pattern by establishing a one-to-one relationship between letters. 🧩 Problem Summary: Given a list of words and a string pattern, return all words that match the pattern. A word matches if you can permute letters such that each letter in the pattern maps uniquely to a letter in the word. 📘 Example: Input: words = ["abc","deq","mee","aqq","dkd","ccc"], pattern = "abb" Output: ["mee","aqq"] 💡 Intuition: To verify a match, we need to ensure: Each character in the pattern maps to only one unique letter in the word. No two pattern characters map to the same word character. This makes it a bijection problem — a perfect use case for hash maps. 🧠 Key Takeaways: Used two hash maps to maintain bijective character mapping. Achieved O(n * k) time complexity, where n = number of words and k = word length. Great practice for mastering string and hashmap-based logic problems. ✨ Every such problem reinforces how powerful simple mapping logic can be when applied thoughtfully. #LeetCode #ProblemSolving #CodingChallenge #DataStructures #Algorithms #ProgrammingJourney
To view or add a comment, sign in
-
-
🚀 Day 19 of #45DaysOfLeetCodeChallenge😎🌱 💡 Problem: Remove Nth Node from End of List 🧩 Platform: LeetCode 🔗 Problem :https://lnkd.in/d8DvFdvf 📌Today’s challenge was all about linked lists — one of the most fundamental and tricky data structures in problem solving. This problem tested my ability to traverse, manipulate, and modify linked lists efficiently without breaking the chain. 🔍 Understanding the Problem: Given the head of a linked list, remove the nth node from the end and return its head. Sounds simple? Not quite — the challenge lies in keeping track of the position from the end while maintaining the structure of the list. ⚙️ Approach: 🔹Used the two-pointer technique (fast and slow pointers). 🔹Moved the fast pointer n steps ahead first. 🔹Then, moved both pointers together until the fast pointer reached the end. 🔹The slow pointer now points to the node before the one to be deleted. 🔹Updated links carefully to remove the target node in one pass 💪 ⏱️ Time Complexity: O(n) 📦 Space Complexity: O(1) 🔥 Key Learnings: ✅ Refreshed my understanding of linked list traversal ✅ Practiced edge case handling (like removing the head node) ✅ Strengthened problem-solving using two-pointer patterns ✅ Enhanced debugging mindset for pointer-based problems 💭 Every day with LeetCode reminds me that consistency > perfection. The more you practice, the more patterns you begin to recognize. And today was another step toward mastering data structures & algorithms! #LeetCode #100DaysChallenge #Day19 #ProblemSolving #CodingChallenge #DSA #LinkedList #TwoPointerTechnique #WomenInTech #KeepCoding #SoftwareEngineerJourney #ConsistencyIsKey
To view or add a comment, sign in
-
-
🔍 Day 66 of #100DaysOfCode 🔍 🔹 Problem: Binary Search – LeetCode ✨ Approach: Implemented an iterative binary search to efficiently locate the target element within a sorted array. By halving the search range each time — adjusting low and high around the mid-point — the algorithm achieves blazing-fast lookups! ⚡ 📊 Complexity Analysis: Time Complexity: O(log n) — array size halves with each iteration Space Complexity: O(1) — constant extra space ✅ Runtime: 0 ms (Beats 100.00%) ✅ Memory: 46.02 MB 🔑 Key Insight: Binary Search is proof that efficiency isn’t about doing more — it’s about eliminating what’s unnecessary. 🚀 #LeetCode #100DaysOfCode #ProblemSolving #DSA #AlgorithmDesign #BinarySearch #LogicBuilding #Efficiency #ProgrammingChallenge #CodeJourney #CodingDaily
To view or add a comment, sign in
-
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