Amazon Interview Question

Count the number of inversions in an array