Find the number of rotations performed on a sorted array

Given a sorted array rotated n times. Find the number of right side rotations performed on the array.
Example:
input: 678912345
expected output: 4 (rotating 123456789 4 times we will get the input)

Leave a Reply