Count Inversions Hackerrank Problem Solution