𝗗𝗮𝘆 𝟲𝟬/𝟭𝟬𝟬 — 𝟲𝟬% 𝗖𝗢𝗠𝗣𝗟𝗘𝗧𝗘 🎉 60 days. 60 problems. 60% done. I showed up every single day. 𝗧𝗼𝗱𝗮𝘆'𝘀 𝗣𝗿𝗼𝗯𝗹𝗲𝗺: ✅ #𝟭𝟱𝟰𝟰: Make The String Great (Easy) 𝗧𝗵𝗲 𝗣𝗿𝗼𝗯𝗹𝗲𝗺: Remove adjacent characters that are the same letter but different cases (like 'A' and 'a'). Keep removing until no more pairs exist. 𝗘𝘅𝗮𝗺𝗽𝗹𝗲: "leEeetcode" → "leetcode" Classic stack behavior. When the top of the stack and current character form a bad pair, pop. Otherwise, push. 𝗠𝘆 𝗦𝗼𝗹𝘂𝘁𝗶𝗼𝗻: Used StringBuilder as a stack. For each character: - Check if it pairs with the last character (difference of 32 in ASCII) - If yes, remove last character - If no, append current character One pass. O(n) time. Clean. 𝗪𝗵𝗮𝘁 𝟲𝟬 𝗗𝗮𝘆𝘀 𝗧𝗮𝘂𝗴𝗵𝘁 𝗠𝗲: 𝗗𝗮𝘆 𝟭: Struggled with basic arrays 𝗗𝗮𝘆 𝟯𝟬: Started linked lists, felt overwhelmed 𝗗𝗮𝘆 𝟱𝟬: Linked lists became second nature 𝗗𝗮𝘆 𝟲𝟬: Stacks, strings, simulation—all clicking The patterns aren't just repeating. They're compounding. 𝗧𝗵𝗲 𝗥𝗲𝗮𝗹 𝗪𝗶𝗻: It's not the 60 problems solved. It's the 60 days of not quitting. Some days were hard. Some days I didn't feel like it. But I showed up anyway. That's the skill that matters—not just in coding, but in everything. 𝗖𝗼𝗱𝗲: https://lnkd.in/gXCJxBmB 60% done. More than halfway. The finish line is in sight. Let's go. 𝗗𝗮𝘆 𝟲𝟬/𝟭𝟬𝟬 ✅ 𝟲𝟬 𝗱𝗼𝘄𝗻. 𝟰𝟬 𝘁𝗼 𝗴𝗼. #100DaysOfCode #LeetCode #60DayMilestone #Consistency #Stack #Algorithms #CodingChallenge #Programming #Java #SoftwareEngineer #GrowthMindset #KeepGoing #NeverQuit #60Percent
More Relevant Posts
-
𝗗𝗮𝘆 𝟳𝟬/𝟭𝟬𝟬 — 𝟳𝟬% 𝗖𝗢𝗠𝗣𝗟𝗘𝗧𝗘 🎉 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
To view or add a comment, sign in
-
🚀 Day 525 of #750DaysOfCode 🚀 💡 LeetCode 1980: Find Unique Binary String Today’s problem was an interesting one involving binary strings and a clever observation. We are given n unique binary strings of length n, and the task is to return any binary string of length n that does not exist in the given array. 🔎 Approach I Used I applied a concept similar to Diagonalization. Traverse the array from 0 → n-1 Look at the i-th character of the i-th string Flip it (0 → 1 or 1 → 0) Append the flipped character to build a new string This guarantees the newly created string differs from every string in the list at least at one position, ensuring it is unique and not present in the array. ⚡ Time Complexity: O(n) ⚡ Space Complexity: O(n) This approach works efficiently because the constraints are small and we only need to ensure one position difference with each string. Problems like this highlight how a simple observation can eliminate brute force completely. #leetcode #coding #programming #java #datastructures #algorithms #problemSolving #developer #codingchallenge #750DaysOfCode
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 89/100 of the LeetCode Challenge 🚀 Today’s problem is "Largest Submatrix With Rearrangements" — a fascinating problem that blends matrix manipulation with greedy thinking and sorting! 📊🔍 At first glance, it seems like a standard submatrix problem, but the twist lies in the ability to rearrange columns freely. This completely changes the game! You can't just look for the largest rectangle of 1's in the grid — you need to think in terms of column-wise heights and then sort them row by row to maximize the area. 🧠✨ The intuition is to transform the grid so that grid[r][c] represents the number of consecutive 1's ending at that cell (like histogram heights). Then, for each row, you take the heights, sort them in descending order, and compute the maximum area possible as height[i] * (i + 1) for each column index. 🔁 📌 Key Steps: Update heights: For each cell, if it's a 1, add the value from the row above (cumulative count). Sort row-wise: For each row, sort the heights in non-increasing order. Calculate area: For each column in the sorted row, area = height * (index + 1), track the max. Return the maximum area across all rows. This approach runs in O(m * n log n) time and is super satisfying once it clicks! 💡 Here’s a Java solution I used today — it passed all 59 test cases with a runtime of 14 ms and memory usage of 115 MB. Not the most optimized, but it’s clean and gets the job done. 💻👨💻 ✅ Key Takeaways: Sorting after computing heights is the magic step ✨ Understanding how to transform a submatrix problem into a histogram problem is a powerful skill Always think about how you can rearrange columns — it’s not about original positions, but about potential! #LeetCode #Day89 #100DaysOfCode #Java #CodingChallenge #Matrix #Greedy #Sorting #Submatrix #Histogram #ProblemSolving #TechJourney #CodeNewbie #LearnToCode #SoftwareEngineering #ProgrammingLife #CodingJourney #Developer #DSA #Algorithms #DataStructures #DailyCoding #CodeDaily #TechCommunity #WomenWhoCode #CodingLife #LeetCodeChallenge #100DaysOfLeetCode
To view or add a comment, sign in
-
-
🚀 Day 78 / 100 – LeetCode Daily Challenge 🧠 Problem: Triconic Subarray Maximum Sum 📅 Date: March 7, 2026 🏆 Runtime: 3 ms | Beats 99.94% 📦 Memory: 95.28 MB | Beats 46.16% 📝 Problem Insight Today’s challenge was to find the maximum sum of a triconic subarray – a sequence that first decreases, then increases, and finally decreases again. It’s like a "mountain" with two peaks and one valley in between, but in a specific order: down → up → down. This is a more complex variant of the classic mountain or bitonic subarray problems. It requires careful scanning of the array to detect valid triconic patterns and compute their sums efficiently. 💡 My Approach I used a two-pointer expansion method: Iterate through the array and treat each index as a potential peak or valley. Expand left and right while the pattern matches the triconic property. Keep track of the maximum sum encountered. Although the code snippet is incomplete here, the full solution involves: Precomputing left and right decreasing/increasing trends. Validating the three-phase pattern for each possible center. Avoiding redundant computations to keep the time complexity close to O(n). 📊 Results ✅ 861 / 861 test cases passed ⚡ Runtime: 3 ms (beats 99.94% of Java submissions) 📈 Memory: 95.28 MB (beats 46.16%) 🧠 Key Takeaway Pattern recognition problems like this one are great for sharpening your array traversal logic and understanding how to break down complex patterns into manageable checks. The challenge is not just in finding the sum, but in ensuring the pattern holds throughout. 🔗 Let’s Connect! I’m documenting my #100DaysOfCode journey every day – follow along for more problem-solving insights, optimizations, and LeetCode grind! 💻⚡ #LeetCode #Java #CodingChallenge #100DaysOfCode #Day78 #TriconicArray #ProblemSolving #TechJourney #SoftwareEngineering #Algorithms #DataStructures #CodeNewbie #DevCommunity #Programming
To view or add a comment, sign in
-
-
✳️Day 17 of #100DaysOfCode✳️ Solving the Longest Common Subsequence Problem! 🚀 I recently took on the "Longest Common Subsequence" (LCS) challenge on LeetCode—a classic problem that perfectly illustrates the power of Dynamic Programming. Here’s the step-by-step approach I took: ✅ 1. Problem Decomposition: I broke the problem down into smaller sub-problems. If the last characters of two strings match, they contribute to the subsequence; if not, we explore the possibilities by skipping a character from either string. ✅ 2. Recursive Foundation: I started by defining the base case—if either string is empty, the LCS length is 0. ✅ 3. Optimization with Memoization: Pure recursion leads to redundant calculations (overlapping sub-problems). I implemented a 2D array (dp[n][m]) to store results of previously computed states, significantly boosting performance. ✅ 4. Refinement: Fine-tuning the logic to ensure the time and space complexity were balanced for an efficient "Accepted" result . Always learning, always coding. On to the next challenge! 💻 #LeetCode #Java #DynamicProgramming #CodingLife #SoftwareEngineering #ProblemSolving
To view or add a comment, sign in
-
-
🚀 Day 68 – DSA Journey | Finding Intersection in Linked Lists Continuing my daily DSA practice, today I solved another linked list problem on LeetCode focusing on pointer techniques and smart traversal. 📌 Problem Practiced: Intersection of Two Linked Lists (LeetCode 160) 🔍 Problem Idea: Given two linked lists, find the node where they intersect. If they don’t intersect, return null. 💡 Key Insight: Instead of calculating lengths, we can use two pointers and switch heads when reaching the end. This ensures both pointers travel equal distance and meet at the intersection. 📌 Approach Used: • Use two pointers (i and j) starting at headA and headB • Traverse both lists • When a pointer reaches null → switch it to the other list • If intersection exists → they meet at the node • Else → both become null 📌 Concepts Strengthened: • Two-pointer technique • Linked list traversal • Handling unequal lengths • Pointer switching trick ⏱️ Time Complexity: O(n + m) 📦 Space Complexity: O(1) 🔥 Today’s takeaway: Sometimes, instead of calculating differences, letting pointers naturally align can simplify the problem. On to Day 69! 🚀 #Day68 #DSAJourney #LeetCode #LinkedList #Java #ProblemSolving #Coding #LearningInPublic #Consistency
To view or add a comment, sign in
-
-
🚀 Day 76 / 100 Days of LeetCode Challenge 🧠 Today’s problem: Minimum Operations to Transform a Binary String I worked on a problem that required counting the number of 0s in a binary string and determining the minimum operations needed based on a given integer k. 📌 Problem intuition: Count the number of zeros in the string. If there are no zeros → already valid → return 0. If the string length equals k and all characters are zeros → 1 operation needed, otherwise -1. Otherwise, compute hase = len - k and proceed with further logic (though the implementation is still in progress). 🔍 Key takeaway: Sometimes the simplest approach—like counting zeros—can form the foundation of a solution. But edge cases like len == k and zero-count logic must be handled carefully to avoid incorrect results. 💻 Code snippet highlights: Loop through string, using bitwise operation ~s.charAt(i) & 1 to count zeros efficiently. Early returns for edge cases. Still refining the full logic, but proud of the progress! 📈 Runtime: 4 ms (Beats 99.66%) 💾 Memory: 47.68 MB (Beats 87.62%) ✅ 999/999 test cases passed #100DaysOfCode #LeetCode #CodingChallenge #Java #ProblemSolving #Algorithms #DataStructures #DeveloperJourney #TechCommunity #DailyCoding #CodeNewbie #WomenInTech #Programming #DevLife #LearnToCode #CodingLife #SoftwareEngineering #Tech #GrowthMindset
To view or add a comment, sign in
-
-
𝗗𝗮𝘆 𝟲𝟵/𝟭𝟬𝟬 — 𝗥𝗲𝗺𝗼𝘃𝗲 𝗞 𝗗𝗶𝗴𝗶𝘁𝘀 Day 69. One day from 70. This problem broke my brain. Then it clicked. 𝗧𝗼𝗱𝗮𝘆'𝘀 𝗣𝗿𝗼𝗯𝗹𝗲𝗺: ✅ #𝟰𝟬𝟮: Remove K Digits (Medium) 𝗧𝗵𝗲 𝗣𝗿𝗼𝗯𝗹𝗲𝗺: Given a number as a string and k, remove k digits to make the smallest possible number. Example: "1432219", k=3 → "1219" Which 3 digits do you remove? And in what order? 𝗧𝗵𝗲 𝗜𝗻𝘀𝗶𝗴𝗵𝘁: Greedy + Monotonic Stack. Remove a digit if the next digit is smaller. Keep the stack increasing. This builds the smallest number left-to-right. Example: "1432219" See '4' then '3'? Remove '4' See '3' then '2'? Remove '3' See '2' then '2'? Keep both Result: "12219" → remove trailing '9' → "1219" 𝗠𝘆 𝗦𝗼𝗹𝘂𝘁𝗶𝗼𝗻: StringBuilder as stack. For each digit: While stack top > current digit AND k > 0: pop and decrement k Append current digit After loop, remove remaining k digits from the end. Strip leading zeros. Time: O(n), Space: O(n) 𝗪𝗵𝘆 𝗜𝘁 𝗠𝗮𝘁𝘁𝗲𝗿𝘀: This combines greedy thinking with monotonic stack. Two patterns, one solution. Understanding when to be greedy and when to use a stack—that's the skill. 𝗖𝗼𝗱𝗲: https://lnkd.in/gv36YUfj 𝗗𝗮𝘆 𝟲𝟵/𝟭𝟬𝟬 ✅ 𝟲𝟵 𝗱𝗼𝘄𝗻. 𝟯𝟭 𝘁𝗼 𝗴𝗼. 𝗧𝗼𝗺𝗼𝗿𝗿𝗼𝘄 = 𝟳𝟬. #100DaysOfCode #LeetCode #MonotonicStack #GreedyAlgorithm #Algorithms #CodingInterview #Programming #Java #MediumLevel #PatternCombination #Day70Tomorrow
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