In Problem 877F , how to apply Mo's algorithm ? while traversing each block what to do ? editorial is not well explained .
Suppose a[] = { 1 , 1 , 1 , -1 } . We want to get all subarray's in the range 2--4 with sum = 1 .
Approach with HashMap would be linear complexity and total Time Complexity would be O(N*Q) if there are q queries.
**how to reduce it to sqrt. decomposition . **