private static int getMinElementInRotArrayHelper(int[] arr, int start, 
            int end)
    {
        if (end < start) return arr[0];
        
        if (start == end)
        {
            return arr[start];
        }
        
        int mid = (start + end) / 2;
        
        if (mid < end && arr[mid+1] < arr[mid])
        {
            return arr[mid+1];
        }
        
        if (mid > start && arr[mid] < arr[mid-1])
        {
            return arr[mid];
        }
        
        if (arr[end] > arr[mid])
        {
            return getMinElementInRotArrayHelper(arr, start, mid-1);
        }
        
        return getMinElementInRotArrayHelper(arr, mid + 1, end);
        
    }