Find the number of subarrays that sum up to x given the size of the array and its elements.
As mentioned here the time complexity is O(NLogN). Is that because of the usage of map, cause if that’s the case why can’t we use unordered_map and get the complexity to O(N).
Also I tried it with unordered_map on CSES and a couple of cases timed out. map works fine.
Am I missing something here.