🧠 Problem 🏷️ Tags array, greedy, prefix-sum 📊 Difficulty Medium ✅ Success Rate: 58.7%📥 Submissions: 2,054📈 Accepted: 1,206 ❤️ Reactions 👍 Likes: 30👎 Dislikes: 12 💡 Hints When should you use your armor ability? It is always optimal to use ...
🧠 Problem 🏷️ Tags array, prefix-sum 📊 Difficulty Medium ✅ Success Rate: 67%📥 Submissions: 1,031📈 Accepted: 691 ❤️ Reactions 👍 Likes: 21👎 Dislikes: 6 💡 Hints How can we use precalculation to efficiently calculate the average difference at ...
In Codechef Round 194 Div 4, there was one particular question that completely shattered my confidence. After failing to solve it during the contest, my brain froze — and I couldn’t think clearly for the remaining problems. But after calming myself d...
LeetCode Link Date: 2nd July 2025 Topics: String, Dynamic Programming, Prefix Sum Problem Understanding LeetCode 3333 builds upon the simpler "Find the Original Typed String I" problem by adding a crucial constraint: we need to find strings of lengt...
Problem https://leetcode.com/problems/maximum-absolute-sum-of-any-subarray/description/ Leetcode - Maximum Absolute Sum of Any Subarray Type - Prefix Sum, Greedy Difficulty - Medium Approach & Solution Within the limit of prefix sum range [0, i], If ...
Problem https://leetcode.com/problems/number-of-sub-arrays-with-odd-sum/description/ Leetcode - Number of Sub-arrays With Odd Sum Type - Prefix Sum, Dynamic Programming Difficulty - Medium Approach && Solution Since the length of arr can be up to 10^...
Welcome to the first article in our DSA Patterns series, where we discuss commonly used patterns to solve coding problems, particularly for interviews. In this blog, we will break down the Prefix Sum with Hash Map technique—a powerful approach for so...
Welcome to Day 17 of my 100 Days of DSA challenge! Today, I explored two essential techniques: Prefix Sum and Two Pointers. These techniques are incredibly efficient for solving problems related to subarray sums and optimized array traversal. The pro...
Code Optimization Method 1 : Least Optimized Method : If you look closely I have added three nested for loops in here, of course this is not going to be a very optimal solution (Hence the execution time is higher) var resolutionTimeList = []; var inc...
Problem Statement Given an array of integers A, let's find and return a new array of the same size. In this new array, each element at index i will be the product of all the elements in the original array except the one at i. Note: You can always cre...