Day 15: Minimum Positive Sum Subarray 🎯
Approach: Brute Force + Prefix Sum
Explore subarrays → Check length & positive sum → Track minimum.
Time: O(n²)
#LeetCode #CPP #DSA #ProblemSolving
10
142
Day 14: Count Non-Decreasing Subarrays After K Operations 🎯
Approach: Sliding Window + Monotonic Stack
Today I learned how to combine monotonic stacks with sliding windows to efficiently handle range operations and maintain a valid window.
#LeetCode #CPP #DSA #ProblemSolving
7
129
Day 13: Longest Strictly Increasing or Strictly Decreasing Subarray 🎯
Approach: Greedy + Single Pass
Track increasing & decreasing lengths → Update maximum.
#LeetCode #CPP #DSA #ProblemSolving
Day 12: Minimum Cost to Acquire Required Items 🎯
⚙️ Approach: Greedy
Compare individual vs. combined costs → Choose the cheapest combination.
💡 Takeaway: Buying extra items can sometimes reduce the overall cost.
⏳ Time: O(1)
#LeetCode #CPP #DSA #ProblemSolving
9
200
Day 11: Climbing Stairs II 🎯
Approach: Dynamic Programming
Try jumps of 1, 2 or 3 steps → Track minimum cost at each step.
Time: O(n)
#LeetCode #CPP #DSA #ProblemSolving
1
4
177
Day 10: Process Tasks Using Servers 🎯
Approach: Two Heaps + Greedy
Track available servers → Assign the lowest-weight server → Manage busy servers by finish time.
Time: O((n + m) log n)
#LeetCode #CPP #DSA #ProblemSolving
10
316
Day 9: Count Zero Request Servers 🎯
Approach: Sorting + Sliding Window
Sort logs → Process query intervals → Count inactive servers.
Takeaway: Sliding windows help efficiently answer range-based queries.
#LeetCode #CPP #DSA #ProblemSolving
Day 7: Find the Distance Value Between Two Arrays 🎯
Compare each element → Check the distance condition → Count valid elements.
Time: O(m × n)
#LeetCode #CPP #DSA #ProblemSolving
1
21
318
Day 6: Minimum Moves to Equal Array Elements III 🎯
⚙️ Approach: Greedy
Find the maximum → Make every element equal to it.
Takeaway: The maximum element gives the optimal target.
⏳ Time: O(n)
GitHub: github.com/anchal-dev/Leetco…
#LeetCode #CPP #DSA #ProblemSolving
1
16
397
Day 5: Minimum Moves to Equal Array Elements II 🎯
⚙️ Approach: Sorting + Median
Find the median → Calculate absolute differences.
Takeaway: Median minimizes total absolute differences.
Time: O(n log n)
GitHub: github.com/anchal-dev/Leetco…
#LeetCode #CPP #DSA #ProblemSolving
1
14
363










