We can determine how "out of order" an array A is by counting the number of inversions it has. Two elements A[i] and A[j] form an inversion if A[i] > A[j] but i < j. That is, a smaller element appears after the larger element.
Write a function
solve that have the following parameter(s):
1.) a = an array of integers
[2, 4, 1, 3, 5]
[1, 2, 3, 4, 5]
• The length of an array should be greater than 0 and less than 800.
• The elements of an array should be greater than 0 and less than 1000.