Rotated Sorted Array solved in O(log n) and O(1) space