Count Inversions Hackerrank Python Solutions