A sorted list with no repeated values was rotated to the left by some amount (for example [1, 2, 3, 4, 5] rotated left by 2 is [3, 4, 5, 1, 2]). Return that amount, a number from 0 to len(nums) - 1.
Example 1
Input:
rotation_count([3, 4, 5, 1, 2])
Output:
3
Example 2
Input:
rotation_count([1, 2, 3])
Output:
0
1 <= len(nums) <= 2 * 10**5-10**9 <= nums[i] <= 10**9in, .index, .count, min or sorted on the whole list, fails them.No results yet
Run your code to check it against the examples, or submit to run every test.