Day 57 — small improvements, big impact 🚀 Solved the Maximum Triplet Sum problem today, focusing on writing cleaner and more efficient logic. Used a HashSet to eliminate duplicates and simplified the approach with sorting. It’s interesting how a small optimization can make the solution more robust and elegant. Consistency is starting to pay off — problems feel more approachable, and thinking is getting sharper 💡 Learning to not just solve, but refine solutions is the real progress. On to Day 58 with the same mindset 🔥 #100DaysOfCode #Java #DSA #ProblemSolving #CodingJourney #Consistency #Learning #SoftwareDevelopment
Solved Maximum Triplet Sum with Optimized Logic
More Relevant Posts
-
#Day82 Of Problem Solving Solved today’s LeetCode Daily Question and got all test cases accepted. Focused on finding the minimum distance between the target element and the given start index. Kept the approach simple—iterated through the array and updated the minimum distance using Math.abs(). Clean logic, efficient, and gets the job done. Performance: Runtime: 1 ms Memory: 45.04 MB Small problems like this are a good reminder that clarity in thinking often beats overcomplication. Staying consistent with daily practice. #LeetCode #Java #ProblemSolving #DSA #CodingJourney #LeetCode #LinkedIn
To view or add a comment, sign in
-
-
#100DaysOfCode – Day 10 📌 Today’s Problem: LeetCode 152 – Maximum Product Subarray This one was tricky and super interesting! Unlike sum problems, product problems behave differently because of negative numbers and zeros. Key Learning: A negative number can flip the result So we track both: maxSoFar → maximum product till current index minSoFar → minimum product (important for negative flip) Core Idea: If current number is negative → swap maxSoFar and minSoFar Update both values at each step Keep track of global maximum Complexity: Time: O(n) Space: O(1) Takeaway: Tracking both max & min is the key to handling negative numbers in product-based problems. #LeetCode #Java #DSA #CodingJourney #Day10
To view or add a comment, sign in
-
-
🚀 Day 33 of #128DaysOfCode 🧩 Problem Insight: The goal was to check whether a given string can be formed by repeating one of its substrings multiple times. 💡 Key Learning: Instead of checking all possible substrings (which can be inefficient), I learned an elegant trick: By concatenating the string with itself and removing the first and last characters, we can determine if the original string exists within it. ⚡ This approach helped me: - Improve my understanding of string patterns - Learn a smart optimization technique - Avoid brute-force solutions 🛠️ Concepts Practiced: - String manipulation - Pattern recognition - Optimized problem-solving approach 📈 Every day I’m getting better at identifying patterns and writing cleaner, more efficient code. #Day33 #128DaysOfCode #Java #DSA #CodingJourney #ProblemSolving #LeetCode
To view or add a comment, sign in
-
-
#Day89 Of Problem Solving Solved today’s LeetCode Daily Question and got it accepted with all 113/113 test cases passing.What stood out this time wasn’t just getting the correct answer, but refining the approach to keep it clean and efficient. The solution uses a simple HashSet-based technique in Java to track elements and check conditions in linear time. Runtime: 2 ms (faster than 97.89% of submissions). Memory usage: something to improve going forward. Small wins like this remind me that consistency matters more than complexity. Writing simple, readable code and understanding why it works always pays off.On to the next problem. #LeetCode #DSA #Java #CodingJourney #ProblemSolving #Consistency #LinkedIn
To view or add a comment, sign in
-
-
Day: 96/365 📌 LeetCode POTD: Minimum Distance to Type a Word Using Two Fingers Hard Key takeaways/Learnings from this problem: 1. This problem is a great example of DP with state as both fingers’ positions, which feels tricky at first but clicks once you model it right. 2. Key learning: instead of deciding both fingers every time, fix one and optimize the movement of the other to reduce complexity. 3. Precomputing distances between characters makes transitions much faster and keeps the code clean. #POTD #365DaysOfCode #DSA #Java #ProblemSolving #LearningInPublic #Consistency 🥷
To view or add a comment, sign in
-
-
Today I solved: Longest Consecutive Sequence 💡 Key Takeaway: Sorting seems like the obvious approach, but it’s not the most optimal. By using a HashSet, we can reduce the time complexity and achieve an O(n) solution. 👉 Approach: - Store all elements in a Set - Start sequence only when the previous number is not present - Count the length of consecutive numbers 📊 Time Complexity: O(n) 🔍 What I learned: Sometimes the best solution comes from avoiding unnecessary work (like sorting) and thinking in terms of direct lookup using hashing. Optimizing the approach is as important as solving the problem 💪 #DSA #LeetCode #Java #CodingJourney #SoftwareEngineering
To view or add a comment, sign in
-
🚀 Day 53 of #100DaysOfLeetCode Solved: Next Greater Element (Leetcode 496) Today’s problem was a great reminder of how powerful Monotonic Stack can be for optimization. 🔹 Approach: Used a stack to maintain decreasing elements Mapped each element to its next greater using a HashMap Reduced time complexity from O(n²) → O(n) 🔹 Key Learning: Small mistakes in conditions (like missing a !) can completely break logic. Attention to detail matters just as much as understanding the concept. 🔹 Complexity: Time: O(n + m) Space: O(n) Consistency > Perfection. Showing up daily and improving step by step. #LeetCode #DSA #Java #CodingJourney #ProblemSolving
To view or add a comment, sign in
-
-
🚀 Day 570 of #750DaysOfCode 🚀 🔍 Problem Solved: Words Within Two Edits of Dictionary Today’s problem was a nice mix of strings + observation. At first glance, it feels like a transformation problem, but it simplifies beautifully. 💡 Key Insight: We don’t actually need to perform edits. We just need to check how many characters are different between two words. 👉 If the difference (Hamming distance) ≤ 2 → it's valid 🧠 Approach: For each word in queries, compare it with every word in dictionary Count character differences If any comparison has ≤ 2 differences → include the word in result ⚡ Early break helps optimize the solution! 📈 Complexity: Time: O(Q × D × n) Space: O(1) ✨ Takeaway: Not every problem needs simulation — sometimes reducing it to a simple comparison metric (like character differences) makes it much easier. Consistency > Complexity 💪 #LeetCode #DSA #Java #CodingJourney #ProblemSolving #Tech #LearningEveryday #Strings
To view or add a comment, sign in
-
-
🚀 Day 11/100 — #100DaysOfLeetCode Consistency continues — one problem closer to better problem-solving skills 💻🔥 ✅ Problem Solved: 🔹 LeetCode 1423 — Maximum Points You Can Obtain from Cards 💡 Concepts Used: Sliding Window Technique Complementary Subarray Thinking 🧠 Key Learning: Instead of directly choosing k cards from both ends, I learned to think differently — find the minimum sum subarray of size n - k and subtract it from the total sum. This transformation converts a complex decision problem into a clean sliding window optimization. ⚡ Takeaway: Sometimes optimization comes from changing perspective, not increasing complexity. Continuing the journey 🚀 #100DaysOfLeetCode #LeetCode #DSA #SlidingWindow #Algorithms #Java #ProblemSolving #CodingJourney #LearningInPublic
To view or add a comment, sign in
-
-
Solved one of the most interesting problems : Subarray Sum Equals K 💡 Key Takeaway: Instead of checking every subarray, tracking prefix sums helps directly identify valid subarrays in an optimized way. 👉 Key Insight: If (prefixSum - k) has already appeared, it means we found a subarray with sum = k. 📊 Time Complexity: O(n) 📦 Space Complexity: O(n) 🔍 What made it interesting? Understanding how previously seen sums help us avoid rework and directly count valid subarrays. Every day I realize: Consistency and clarity of concepts matter more than just solving problems. 💪 #DSA #Java #LeetCode #CodingJourney #BackendDeveloper #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