𝗗𝗮𝘆 𝟳𝟬/𝟭𝟬𝟬 — 𝟳𝟬% 𝗖𝗢𝗠𝗣𝗟𝗘𝗧𝗘 🎉 70 days. 70 problems. 70% done. 𝗜 𝗱𝗶𝗱𝗻'𝘁 𝗾𝘂𝗶𝘁. 𝗧𝗼𝗱𝗮𝘆'𝘀 𝗣𝗿𝗼𝗯𝗹𝗲𝗺: ✅ #𝟭𝟵𝟭𝟬: Remove All Occurrences of a Substring (Medium) 𝗧𝗵𝗲 𝗣𝗿𝗼𝗯𝗹𝗲𝗺: Remove all occurrences of a substring from a string. Keep removing until no more exist. Example: s = "daabcbaabcbc", part = "abc" → "dab" Stack behavior again. Build string character by character. Check the end for pattern matches. Remove when found. 𝗠𝘆 𝗦𝗼𝗹𝘂𝘁𝗶𝗼𝗻: StringBuilder as stack. For each character: Append it Check if the last m characters match the pattern If yes, delete them Continue Time: O(n × m), Space: O(n) 𝗪𝗵𝗮𝘁 𝟳𝟬 𝗗𝗮𝘆𝘀 𝗧𝗮𝘂𝗴𝗵𝘁 𝗠𝗲: 𝗗𝗮𝘆 𝟭: Basic arrays felt hard 𝗗𝗮𝘆 𝟯𝟬: Started linked lists, struggled 𝗗𝗮𝘆 𝟱𝟬: Linked lists = second nature 𝗗𝗮𝘆 𝟲𝟬: Stacks, queues, patterns everywhere 𝗗𝗮𝘆 𝟳𝟬: Combining patterns feels natural The progression is real. The compound effect is real. 𝗧𝗵𝗲 𝗧𝗿𝘂𝘁𝗵: 70 days ago, I wasn't sure I could finish this. Some days I didn't want to code. Some days felt pointless. But I showed up anyway. 𝗧𝗵𝗮𝘁'𝘀 𝘁𝗵𝗲 𝘀𝗸𝗶𝗹𝗹 𝘁𝗵𝗮𝘁 𝗺𝗮𝘁𝘁𝗲𝗿𝘀—not talent, not motivation, but showing up when you don't feel like it. 𝗖𝗼𝗱𝗲: https://lnkd.in/gd-QRcxU 𝟳𝟬 𝗱𝗼𝘄𝗻. 𝟯𝟬 𝘁𝗼 𝗴𝗼. 70% complete. The finish line is close. Let's bring this home. 𝗗𝗮𝘆 𝟳𝟬/𝟭𝟬𝟬 ✅ #100DaysOfCode #LeetCode #70DayMilestone #Consistency #Stack #Algorithms #CodingChallenge #Programming #Java #NeverQuit #GrowthMindset #70Percent #AlmostThere
More Relevant Posts
-
🚀 Day 546 of #750DaysOfCode🚀 🔥 Solved: Check if Strings Can be Made Equal With Operations I (LeetCode Easy) 💡 Problem Insight We are allowed to swap characters at indices where: 👉 j - i = 2 This means: Index 0 ↔ 2 (even positions) Index 1 ↔ 3 (odd positions) 🚫 But we cannot mix even and odd indices 🧠 Key Observation The string is divided into 2 independent groups: Even indices → (0, 2) Odd indices → (1, 3) 👉 We can rearrange within each group freely 👉 So both groups must match between s1 and s2 ⚡ Approach Extract characters: Even indices from both strings Odd indices from both strings Sort both groups Compare: Even parts must match Odd parts must match 📈 Complexity Time: O(1) Space: O(1) 💬 Key Takeaway Sometimes problems look like string manipulation, but the real trick is: 👉 Understanding constraints → grouping → independent transformations 🔁 Consistency check ✔️ Another day, another step forward 🚀 #LeetCode #DataStructures #Algorithms #Java #CodingChallenge #ProblemSolving #100DaysOfCode #Consistency
To view or add a comment, sign in
-
-
Day 36/50 🚀 Solved “Valid Parentheses” today — a classic stack problem, but a great reminder that simple concepts can be powerful when applied correctly. 💡 Key takeaway: Using a stack makes it easy to track opening brackets and validate matching pairs efficiently. Every closing bracket should correspond to the most recent unmatched opening one — LIFO in action. ⚙️ What I focused on: Clean conditional checks Avoiding unnecessary complexity Writing readable, structured code 📈 Result: Accepted ✅ Optimized runtime & solid performance On to Day 37 🔥 #50DaysOfCode #DataStructures #Algorithms #Java #LeetCode #CodingJourney
To view or add a comment, sign in
-
-
Day 38 of 100 Days of LeetCode Challenge Today’s problem: Sum of All Odd Length Subarrays My approach: The goal of this problem is to find the sum of all subarrays whose length is odd. Instead of generating every subarray explicitly, I focused on understanding how many times each element contributes to an odd length subarray. For every element at index i, I first calculate how many total subarrays include that element. This can be found using the formula (i + 1) * (n - i), where n is the length of the array. This represents the number of ways we can choose the start and end positions so that the element at index i is included. Out of these total subarrays, only half of them will have odd length. So we calculate the number of odd subarrays using (total + 1) / 2. Then the contribution of the element to the final sum is its value multiplied by the number of odd subarrays it appears in. By repeating this for every element and adding all contributions together, we get the final answer efficiently in linear time. Consistency is not about doing something big once. It is about doing small things every single day until they become powerful results. #100DaysOfLeetCode #LeetCode #DataStructures #Algorithms #ProblemSolving #CodingJourney #Consistency #DailyCoding #Java
To view or add a comment, sign in
-
-
🚀 Day 63 of #100DaysOfLeetCode ✅ Problem Solved: Unique Binary Search Trees (LeetCode 96) Today’s problem was a great example of how Dynamic Programming and mathematical patterns (Catalan Numbers) come together. 🔍 Key Insight: For every node chosen as root, the number of unique BSTs is: 👉 Left Subtrees × Right Subtrees This leads to the recurrence: dp[n] = Σ (dp[left] × dp[right]) 💡 What I learned: Breaking problems into smaller subproblems makes complex structures easier Recognizing patterns like Catalan Numbers is a game changer DP is not just about arrays, it's about thinking smart ⚡ Result: ✔️ Runtime: 0 ms (Beats 100%) ✔️ Clean and optimized solution Consistency is slowly turning into confidence 💪 #LeetCode #DataStructures #DynamicProgramming #CodingJourney #ProblemSolving #Java #100DaysOfCode
To view or add a comment, sign in
-
-
🚀 Day 67 – DSA Journey | Converting Binary Linked List to Integer Continuing my daily DSA practice, today I solved another linked list problem on LeetCode focusing on number conversion and traversal. 📌 Problem Practiced: Convert Binary Number in a Linked List to Integer (LeetCode 1290) 🔍 Problem Idea: Given a linked list where each node contains 0 or 1, convert the binary number into its decimal equivalent. 💡 Key Insight: Instead of storing the binary number, we can directly compute the decimal value while traversing the list using the formula: result = result * 2 + current value. 📌 Approach Used: • Initialize result as 0 • Traverse the linked list • At each node → multiply result by 2 and add current value • Return final result 📌 Concepts Strengthened: • Linked list traversal • Binary to decimal conversion • Iterative computation • Space optimization ⏱️ Time Complexity: O(n) 📦 Space Complexity: O(1) 🔥 Today’s takeaway: You don’t always need extra storage—sometimes you can compute results on the go efficiently. On to Day 68! 🚀 #Day67 #DSAJourney #LeetCode #LinkedList #Java #ProblemSolving #Coding #LearningInPublic #Consistency
To view or add a comment, sign in
-
-
Day 70 - LeetCode Journey Solved LeetCode 88: Merge Sorted Array (Easy) today — a classic problem that focuses on array manipulation and the two-pointer technique. The challenge is to merge two sorted arrays into one sorted array without using extra space, by modifying nums1 in-place. 💡 Core Idea: Instead of merging from the beginning, we start from the end of the arrays. Why? Because nums1 already has extra space at the end to accommodate elements from nums2. We use three pointers: • i → last valid element in nums1 • j → last element in nums2 • k → last position of merged array At each step, we place the larger element at position k, ensuring the array remains sorted. ⚡ Key Learning Points: • Using the two-pointer technique from the end • Performing in-place array merging • Maintaining O(m + n) time complexity • Avoiding unnecessary extra space This problem is a great reminder that sometimes changing the direction of traversal makes the solution much simpler. ✅ Better understanding of array manipulation ✅ Stronger grasp of two-pointer techniques ✅ Improved problem-solving efficiency Small problems like this build strong fundamentals for bigger challenges 🚀 #LeetCode #DSA #Java #TwoPointers #Arrays #Algorithms #ProblemSolving #CodingJourney #Consistency #100DaysOfCode #InterviewPreparation #DeveloperGrowth #KeepCoding
To view or add a comment, sign in
-
-
🚀 Day 72 – DSA Journey | Reversing a Sublist in Linked List Continuing my daily DSA practice, today I worked on a classic linked list problem that tested my understanding of pointer manipulation and in-place reversal. 📌 Problem Practiced: Reverse Linked List II (LeetCode 92) 🔍 Problem Idea: Reverse a portion of a linked list between given positions left and right, without affecting the rest of the list. 💡 Key Insight: Instead of reversing the entire list, the trick is to re-link nodes within the given range by carefully adjusting pointers. 📌 Approach Used: • Use a dummy node to handle edge cases • Traverse to the node just before left • Iteratively move nodes to the front of the sublist • Maintain connections with the remaining list 📌 Concepts Strengthened: • Linked list traversal • Pointer manipulation • In-place reversal • Handling edge cases ⏱️ Time Complexity: O(n) 📦 Space Complexity: O(1) 🔥 Today’s takeaway: Small pointer changes can drastically transform a data structure — understanding them deeply is key. On to Day 73! 🚀 #Day72 #DSAJourney #LeetCode #LinkedList #Java #ProblemSolving #Coding #LearningInPublic #Consistency
To view or add a comment, sign in
-
-
Day 82 - LeetCode Journey 🚀 Solved LeetCode 92: Reverse Linked List II (Medium) — a powerful problem that takes basic reversal to the next level. We already know how to reverse an entire linked list. But here, the challenge is to reverse only a specific portion — between positions left and right — while keeping the rest intact. 💡 Core Idea (Partial Reversal + Pointer Rewiring): Use a dummy node to simplify edge cases Move a pointer (prev) to the node just before position left Start reversing nodes one by one within the given range Reconnect the reversed sublist back to the original list This is done using in-place pointer manipulation. 🤯 Why it works? Because instead of reversing the entire list, we carefully rewire only the required segment, preserving connections before and after the range. ⚡ Key Learning Points: • Partial reversal of linked list • Advanced pointer manipulation • Importance of dummy node in edge cases • In-place modification without extra space • Maintaining O(n) time and O(1) space This problem is a big step up from basic linked list reversal. Also, this pattern connects with: Reverse Linked List (full reversal) Reverse Nodes in k-Group Reorder List Palindrome Linked List ✅ Better control over pointer operations ✅ Strong understanding of in-place transformations ✅ Confidence with medium-level linked list problems From full reversal to selective reversal — this is real progress 🚀 #LeetCode #DSA #Java #LinkedList #Algorithms #ProblemSolving #CodingJourney #Consistency #100DaysOfCode #InterviewPreparation #DeveloperGrowth #KeepCoding
To view or add a comment, sign in
-
-
Day 15 of my #30DayCodeChallenge: Swapping Nodes in Pairs! The Problem: Swap Nodes in Pairs. Given a linked list, the goal is to swap every two adjacent nodes and return its head. You must solve the problem without modifying the values in the list's nodes (only nodes themselves may be changed). The Logic: This problem is a classic exercise in Pointer Manipulation and maintaining structural integrity in a Linked List: 1. Dummy Node Strategy: I initialized a dummy node pointing to the head. This acts as a fixed anchor, ensuring I can easily return the new head of the list even after the original head has been swapped. 2. The Three-Pointer Dance: To swap two nodes (cur and t), I need ✓ nage three specific connections for every pair: **-Point the previous node (pre) to the second node of the pair (t). **- Point the first node (cur) to the node following the pair (t. next). **- Point the second node (t) back to the first node (cur). 3. Iterative Traversal: The loop continues as long as there is a full pair remaining (cur ! = nul1 && cur.next ! = null). After each swap, the pre and cur pointers shift forward to prepare for the next pair. Another step closer to mastery. Onward to Day 16! #Java #Algorithms #DataStructures #LinkedList #ProblemSolving #150DaysOfCode #SoftwareEngineering
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