🚀 Day 132 of #1000DaysOfCode LeetCode Daily Challenge — Day 56 56 days. Zero breaks. Steady execution. Today’s problem revolved around custom sorting logic using bit manipulation — ordering integers based on the number of set bits with a well-structured comparator. Key takeaways: • Strengthened understanding of custom comparator design • Applied bitCount effectively within sorting logic • Reinforced hybrid thinking: bit manipulation + sorting • Improved clarity in writing clean and optimized Java solutions ✔️ Accepted solution 🔁 56-Day Coding Streak At this stage, pattern recognition is becoming faster. Less hesitation. More structure. Cleaner implementation. Onward to 60 days. 🚀 #LeetCode #Consistency #Algorithms #DataStructures #Java #BitManipulation #Sorting #ProblemSolving #SoftwareEngineering #CodingJourney
LeetCode Day 56: Custom Sorting with Bit Manipulation
More Relevant Posts
-
🚀 Day 133 of #1000DaysOfCode LeetCode Daily Challenge — Day 57 57 consecutive days. Consistency is no longer effort — it’s routine. Today’s challenge focused on binary simulation and carry propagation — optimizing the number of steps required to reduce a binary string under defined operations. ⚡ Runtime: 0 ms — Beat 100% Key takeaways: • Strengthened understanding of binary arithmetic simulation • Improved carry handling logic during reverse traversal • Practiced writing efficient linear-time solutions • Continued refining clean and minimal Java implementation ✔️ Accepted solution 🔁 57-Day Coding Streak The biggest change after 50+ days? Problems feel structured. Patterns feel familiar. Execution feels faster. Onward to 60 days. 🚀 #LeetCode #Consistency #Algorithms #DataStructures #Java #BitManipulation #ProblemSolving #100Percentile #SoftwareEngineering #CodingJourney
To view or add a comment, sign in
-
-
🚀 Day 29/60 — LeetCode Discipline Problem Solved: Longest Common Prefix Difficulty: Easy Today’s problem focused on identifying the longest common starting pattern across multiple strings — a classic exercise in string comparison and iteration. The approach involved checking characters position by position across all strings until a mismatch is found. This reinforces how simple iterative logic can elegantly solve problems involving multiple inputs. It’s a reminder that sometimes, clarity in approach matters more than complexity in code. 💡 Focus Areas: • Strengthened string traversal techniques • Practiced comparing multiple inputs efficiently • Improved understanding of edge cases (empty strings, mismatch handling) • Reinforced early stopping conditions for optimization • Focused on clean and readable logic ⚡ Performance Highlight: Achieved efficient runtime with minimal overhead. Finding common ground across multiple inputs is not just a coding skill — it’s a pattern recognition mindset. #LeetCode #60DaysOfCode #100DaysOfCode #DSA #Strings #Algorithms #ProblemSolving #CodingJourney #SoftwareEngineering #Java #Developers #Consistency #TechGrowth #LearnToCode
To view or add a comment, sign in
-
-
🚀 Day 6 – LeetCode Practice Today, I solved the Divide Two Integers problem on LeetCode: 🎯 Difficulty: Medium 💻 Language Used: Java 💡 Approach: • Given two integers dividend and divisor, the task was to divide them without using multiplication, division, or modulus operators. • I handled edge cases like overflow and negative values first. • Converted values to long to avoid overflow while calculating. • Used bit manipulation (left shifts) to subtract multiples of divisor efficiently, mimicking division logic. • Adjusted sign of the result based on original signs. ⏱ Complexity: • Time Complexity: O(log n) (where n = absolute dividend) • Space Complexity: O(1) 📚 Key Takeaway: This problem strengthened my understanding of bit manipulation, efficient arithmetic without built-in operators, and careful edge case handling for overflow and sign corrections. Consistent problem-solving practice continues to enhance my logic, efficiency, and confidence in algorithmic challenges. 💪 #LeetCode #Java #DSA #BitManipulation #ProblemSolving #Algorithms #100DaysOfCode #SoftwareDeveloper
To view or add a comment, sign in
-
-
🚀 Day 30/60 — LeetCode Discipline Problem Solved: 3Sum Closest Difficulty: Medium Today’s problem pushed beyond exact answers and focused on finding the closest possible sum to a given target — a subtle yet powerful variation of the classic 3Sum problem. By sorting the array and using a two-pointer approach, the solution efficiently explores combinations while continuously updating the closest result. This problem highlights how small modifications in logic can significantly change the nature of a problem — from exact matching to optimal approximation. 💡 Focus Areas: • Strengthened two-pointer technique • Practiced working with sorted arrays • Improved handling of optimization conditions • Learned to track and update closest values dynamically • Reinforced problem-solving under constraints ⚡ Performance Highlight: Achieved efficient runtime with optimized traversal. Not every problem asks for perfection — sometimes, the goal is to get as close as possible. #LeetCode #60DaysOfCode #100DaysOfCode #DSA #TwoPointers #Algorithms #ProblemSolving #CodingJourney #SoftwareEngineering #Java #Developers #Consistency #TechGrowth #LearnToCode
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
-
-
📌 LeetCode Daily Challenge — Day 3 Problem: 1545. Find Kth Bit in Nth Binary String Topic: String, Recursion, Divide and Conquer 🧠 Approach (Simple Thinking): 🔹 Every string Sn is made of 3 parts: The previous string S(n-1) on the left A single "1" sitting right in the middle The flipped and reversed version of S(n-1) on the right 🔹 The string doubles in size every level by S20 you're looking at 1M+ characters. Building it fully? Not a chance. So instead, we recursively figure out which part position k falls into 🔹 If k is in the left half → it behaves exactly like S(n-1). Just recurse with the same k and go one level down 🔹 If k is exactly the middle → no need to recurse at all. The middle is always '1', guaranteed by construction 🔹 If k is in the right half → the right half is a mirror of the left half but with all bits flipped. So we calculate the mirrored position, recurse into the left half to get that bit, and then flip the answer 🔹 Base case → when n = 1, the string is just "0". Return it and start unwinding ⏱️ Time Complexity: Recurse at most n levels deep → O(n) n = the level of the binary string 📦 Space Complexity: Recursive call stack depth is n → O(n) No extra arrays or data structures created 📝 Put together a full walkthrough covering the approach, dry run, and code explanation. 👉 check it out here: https://lnkd.in/gGrReU9W Got a different way to tackle this? Always curious to see alternate approaches share it in the comments below! 🙌 Until the next one, happy coding! 🚀 #LeetCode #Java #SoftwareEngineer #ProblemSolving #BackendDeveloper
To view or add a comment, sign in
-
-
🚀 Day 8 – LeetCode Practice Today, I solved the Count and Say problem on LeetCode: 🎯 Difficulty: Easy / Medium 💻 Language Used: Java 💡 Approach: • The “count and say” sequence is built by reading off digits of the previous term — counting repeated digits then describing them. • I started from the base term "1" and iteratively built the next term by scanning the current string and describing consecutive runs of the same character. • This continues until the nth term is generated. ⏱ Complexity: • Time Complexity: O(n × k) (n = sequence length, k = average term length) • Space Complexity: O(k) 📚 Key Takeaway: This problem improved my understanding of string manipulation and iterative pattern construction. Carefully building and transforming sequences is a useful technique in many real-world problems. Consistent problem-solving practice continues to strengthen my logic and coding confidence 💪 #LeetCode #Java #DSA #Strings #ProblemSolving #Algorithms #CodingPractice #100DaysOfCode #SoftwareDeveloper
To view or add a comment, sign in
-
-
🚀 Day 6 – LeetCode Practice Today, I solved the Remove Element problem on LeetCode: 🎯 Difficulty: Easy 💻 Language Used: Java 💡 Approach: • Given an integer array nums and a value val, the task was to remove all occurrences of val in-place and return the new length. • I used the two-pointer technique: – One pointer (slow) tracked where to place the next non-val element. – The other pointer (fast) scanned the array from left to right. • When the current element wasn’t equal to val, I copied it to slow and advanced both pointers. • This ensured we overwrote unwanted values and kept the rest in place without extra space. ⏱ Complexity: • Time Complexity: O(n) • Space Complexity: O(1) 📚 Key Takeaway: This problem reinforced in-place modification and efficient array traversal with minimal space. Simple pointer strategies often help optimize brute-force approaches. Consistent problem-solving practice continues to strengthen my fundamentals and coding clarity. 💪 #LeetCode #Java #DSA #TwoPointers #Arrays #ProblemSolving #Algorithms #100DaysOfCode #SoftwareDeveloper
To view or add a comment, sign in
-
-
🚀 Day 5 – LeetCode Practice Today, I solved the Reverse Nodes in k-Group problem on LeetCode: 🎯 Difficulty: Hard 💻 Language Used: Java 💡 Approach: • Given a linked list and an integer k, the task was to reverse every group of k nodes. • I used pointer manipulation and a dummy node to handle group reversals cleanly. • Moved through the list in blocks of k, reversing each sub-group by re-wiring next pointers. • Ensured that if the final group had fewer than k nodes, it was kept as-is. • This approach ensured in-place reversal without extra space. ⏱ Complexity: • Time Complexity: O(n) • Space Complexity: O(1) 📚 Key Takeaway: This problem deepened my understanding of in-place linked list manipulation, group operations, and edge-case handling when list length isn’t a multiple of k. Solving pattern-rich, hard problems like this consistently improves my algorithmic thinking and implementation precision. 💪 #LeetCode #Java #DSA #LinkedList #ProblemSolving #Algorithms #CodingPractice #100DaysOfCode #SoftwareDeveloper
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