suppose array length n sort ascending order rotate 1 n time for example array num 0124567 become4567012 rotate 4 times0124567 rotate 7 timesnotice rotate array a0 a1 a2 an1 1 time result array an1 a0 a1 a2 an2given sort rotate array num unique element return minimum element arrayyou write algorithm run Olog n time Example 1input num 34512output 1explanation the original array 12345 rotate 3 timesexample 2input num 4567012output 0explanation the original array 0124567 rotate 4 timesExample 3input num 11131517output 11explanation the original array 11131517 rotate 4 time Constraintsn numslength1 n 50005000 numsi 5000all integer num uniquenum sort rotate 1 n time