You’re given a rotated sorted array, arr, of length
For example,
Before rotation, arr
After
Mathematically, we can say that if the original array was
First rotation:
Second rotation:
Third rotation:
In the example above, the minimum element is
For the given array, your task is to find the minimum element of this array.
Constraints:
arr.length
arr[i]
All the elements of the array are distinct, that is, there are no duplicate elements.
You’re given a rotated sorted array, arr, of length
For example,
Before rotation, arr
After
Mathematically, we can say that if the original array was
First rotation:
Second rotation:
Third rotation:
In the example above, the minimum element is
For the given array, your task is to find the minimum element of this array.
Constraints:
arr.length
arr[i]
All the elements of the array are distinct, that is, there are no duplicate elements.