Comments

For Problem C, I tried creating a prefix sum array of the number of inversions in the string, and for each range inserting the number of inversions into a set. At the end, I printed the number of elements in the set — does anyone know why this doesn't work?