Last updated
Last updated
Check if the array was originally sorted in non-decreasing order, then rotated some number of positions (including zero).
If the array is sorted then it will have 0 inversion, if a sorted array is rotated either clockwise or anti-clockwise direction the amount of inversion will be 1.
#array