added sort_and_count_inversions.rb