HackerRank's "Counting Inversions" problem - Python solution This solution uses a binary indexed tree (also known as Ryabko/Fenwick tree). https://www.hackerrank.com/challenges/ctci-merge-sort/problem