CN: Number of rotations in sorted array

#binary-search

Problem

Intuition

It is the same as finding the minimum value in rotated sorted array. 153. Find Minimum in Rotated Sorted Array.

The number of rotations is the index in which minimum value is present.

Time Complexity

O(log n)

Space Complexity

O(1)

Solution

Last updated