brute force, divide and conquer methods to count inversions