Largest subarray with sum equal to 0
I have to admit I didn't fully understood the algorithm. Anyway it seems suboptimal, due to use of heaviweight containers and a nested loops, and is really hard to follow.

I would rather start with an observation that replacing the array with its partial sums reduces the problem to finding two equal elements as distant as possible (two partial sums being equal means the sum in between is 0). This is pretty trivial:


Calculate partial sums (\$O(n)\$)
Stable sort (sum(i),i) tuples (\$O(n\log^2n\$))
Scan for largest equal range (\$O(n)\$)