category-wise-problems

contains category wise problems(data structures, competitive) of popular platforms.

View the Project on GitHub mayankdutta/category-wise-problems

Number of subarrays having absolute sum greater than K

similar to 1590. Make Sum Divisible by P and Count of subarrays having sum equal to its length
Explanation - You need to remember `subarray(i, j) = prefix(i) - prefix(j)`, where `i >= j` - relation reduced to `prefix(j) <= prefix(i) - k` - relation reduced to `prefix(j) + k <= prefix(i)` - at each jth value apply upper bound to count the values - **corner case**, count each number having `value >= k` individually.