I came across 2 problem in your approach: 1) If you are doing it O(n) then you could do a simple scan and just minimum value and then return its index. This could have avoided your complex code. 2) Time complexity is O(log n): http://stackoverflow.com/questions/2796413/binary-search-to-find-the-rotation-point-in-a-rotated-sorted-list