Day: 76/365 📌 LeetCode POTD: Maximum Non Negative Product in a Matrix Medium Key takeaways/Learnings from this problem: 1. This problem shows why tracking only max isn’t enough—you need both max and min products because negatives can flip the result. 2. Classic DP twist where each cell depends on top and left, but with sign handling making it interesting. 3. Big takeaway: whenever multiplication + negatives are involved, always think about dual states (min & max). #POTD #365DaysOfCode #DSA #Java #ProblemSolving #LearningInPublic #Consistency 🥷
Max Non-Negative Product in Matrix: LeetCode Challenge
More Relevant Posts
-
Day: 95/365 📌 LeetCode POTD: Minimum Distance Between Three Equal Elements II Medium Key takeaways/Learnings from this problem: 1. This one highlights how tracking indices smartly is more important than checking all triplets brute-force. 2. Using previous occurrences helps you narrow down valid triples quickly instead of re-scanning the array. 3. Big takeaway: problems with “equal elements” often reduce to index management + pattern observation. 4. Also a good reminder that optimizing from O(n³) thinking to near O(n) comes down to storing the right info while iterating. #POTD #365DaysOfCode #DSA #Java #ProblemSolving #LearningInPublic #Consistency 🥷
To view or add a comment, sign in
-
-
𝐃𝐚𝐲 87/100 – 𝐋𝐞𝐞𝐭𝐂𝐨𝐝𝐞 𝐂𝐡𝐚𝐥𝐥𝐞𝐧𝐠𝐞 🚀 Problem: 228. 𝐒𝐮𝐦𝐦𝐚𝐫𝐲 𝐑𝐚𝐧𝐠𝐞𝐬 Today I solved a problem where we need to summarize consecutive numbers in a sorted unique array into ranges. 🔑 𝐈𝐝𝐞𝐚: Traverse the array and keep extending the range while consecutive numbers continue. Once the sequence breaks, close the range and store it. 💡 𝐀𝐩𝐩𝐫𝐨𝐚𝐜𝐡: Start with the first element as start Move forward while nums[i] + 1 == nums[i+1] If range exists → "start->end" Else → single number "start" 𝐊𝐞𝐲 𝐈𝐧𝐬𝐢𝐠𝐡𝐭: Efficient single pass solution (O(n)) by grouping consecutive elements on the fly. #LeetCode #Java #ProblemSolving #DSA #100DaysOfCode #CodingJourney
To view or add a comment, sign in
-
-
🚀 Day 71/100 – LeetCode Challenge Solved: Remove Duplicates from Sorted List II (Medium) Today’s problem was a great test of Linked List manipulation and handling edge cases efficiently. 🔍 Key Insight: Since the list is sorted, duplicates appear consecutively. Instead of keeping one copy, the challenge is to remove all nodes with duplicate values, leaving only distinct elements. 💡 Approach: Used a dummy node to handle edge cases Applied two-pointer technique (prev & current) Skipped entire duplicate sequences in one pass ⚡ Result: Runtime: 0 ms (Beats 100%) Space Complexity: O(1) 🎯 Key Learning: Handling duplicates in linked lists requires careful pointer updates — especially when the head itself is part of duplicates. Consistency is key 🔥 #Day71 #LeetCode #100DaysOfCode #Java #DataStructures #LinkedList #ProblemSolving #CodingJourney
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
-
-
🚀 𝗗𝗮𝘆 𝟭𝟬 𝗼𝗳 𝟭𝟬𝟬: 𝗦𝗼𝗹𝘃𝗶𝗻𝗴 LeetCode! Today I focused on applying the 𝗣𝗿𝗲𝗳𝗶𝘅 𝗦𝘂𝗺 concept to identify balanced positions in an array. 📌 𝗣𝗿𝗼𝗯𝗹𝗲𝗺𝘀 𝗦𝗼𝗹𝘃𝗲𝗱 𝗧𝗼𝗱𝗮𝘆 (𝗗𝗮𝘆 𝟭𝟬) 🔹 𝗙𝗶𝗻𝗱 𝘁𝗵𝗲 𝗠𝗶𝗱𝗱𝗹𝗲 𝗜𝗻𝗱𝗲𝘅 𝗶𝗻 𝗔𝗿𝗿𝗮𝘆 ✅ Goal: Find an index where the sum of elements on the left is equal to the sum on the right. If multiple exist, return the leftmost one. Approach: Calculated the total sum of the array, then traversed it while maintaining a running left sum. At each index, compared left sum with "(total sum - left sum - current element)" to check if it satisfies the condition, achieving O(n) time complexity. #100DaysOfCode #DSA #LeetCode #Java #ProblemSolving #CodingJourney #PrefixSum #Arrays
To view or add a comment, sign in
-
-
🚀 Day 64/100 Today’s problem: Find all strings that are substrings of another word 🧠 What I learned: - How to compare strings using nested loops - Using ".contains()" to check substrings efficiently - Importance of breaking early to optimize performance - Strengthening problem-solving with brute-force approach 💡 Key Insight: Sometimes simple solutions (O(n²)) are enough when constraints are small. No need to overcomplicate! 🔁 Consistency > Perfection #Day64 #DSA #Java #CodingJourney #Consistency #KeepLearning #100DaysOfCode
To view or add a comment, sign in
-
-
Day 56 : Crushing Binary Trees on LeetCode 💡 Today’s live practical session in Alpha Plus 7.0 We focused on some of the most challenging Binary Tree questions on LeetCode, breaking down the logic behind them. What I practiced today: ✅ Tree Diameter: understand the logic to calculate the absolute longest path between any two nodes in the entire tree. ✅ Maximum Path Sum: Tackled a famous "Hard" level problem! Figured out how to find the path with the highest possible sum, even if it doesn't pass through the root. ✅ Target Deletion: Wrote the recursive code to systematically find and delete leaf nodes that match a specific target value. #BinaryTree #LeetCode #ProblemSolving #DSA #Java #SoftwareEngineering #100DaysOfCode #ApnaCollege
To view or add a comment, sign in
-
-
Day 31/50 🚀 — Reverse Vowels of a String (LeetCode 345) Today’s problem was a great reminder that sometimes the simplest approaches are the most efficient. 🔹 Used the two-pointer technique 🔹 Focused on in-place swapping 🔹 Optimized for both time (O(n)) and space (O(1)) Key takeaway: Instead of overthinking, break the problem into smaller checks—identify vowels, move pointers smartly, and swap only when needed. Clean and efficient 💡 Happy to see this solution performing well: ⚡ Runtime: 2 ms (faster than 99%+) 📦 Space: Decent optimization #Day31 #LeetCode #DSA #Java #CodingJourney #50DaysOfCode #ProblemSolving #SoftwareEngineering
To view or add a comment, sign in
-
-
Day: 94/365 📌 LeetCode POTD: Minimum Distance Between Three Equal Elements I Easy Key takeaways/Learnings from this problem: 1. This problem is a nice reminder that tracking indices smartly is often more important than the values themselves. 2. Keeping the last few occurrences of each element helps you quickly check valid triplets without brute force. 3. It shows how a simple hashmap or array tracking can turn an O(n³) idea into something efficient. #POTD #365DaysOfCode #DSA #Java #ProblemSolving #LearningInPublic #Consistency 🥷
To view or add a comment, sign in
-
-
🚀 100 Days of Code Day -27 LeetCode Problem solved- Divide Two Integers Solved this interesting problem where division is performed without using multiplication, division, or mod operators. 💡 Key Learnings: Used bit manipulation (left shift) to optimize repeated subtraction Handled edge cases like overflow (Integer.MIN_VALUE) Achieved efficient solution with O(log n) complexity 📌 This problem really strengthens understanding of low-level operations and optimization techniques. Always fascinating to see how basic operations can be built from scratch! #LeetCode #Java #DSA #CodingInterview #ProblemSolving
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