int binarySearchRotated( int[] A, int target, int start, int end ) {
        if( end < start ) return -1;
        int mid = (start + end) / 2;
        if( A[mid] == target ) return mid;
        if( A[start] <= A[mid] ) {
            if( target >= A[start] && target < A[mid] ) return binarySearch( A, target, start, mid - 1 );
            else return binarySearchRotated( A, target, mid + 1, end );
        } else {
            if( target > A[mid] && target <= A[end] ) return binarySearch( A, target, mid + 1, end );
            else return binarySearchRotated( A, target, start, mid - 1 );
        }
    }