public static int findPivotIndex(int[] arr){
        int start = 0, end = arr.length - 1;
        while(arr[start] > arr[end]){
            int mid = start + (end - start)/2;
            if(arr[mid] > arr[end]){
                start = mid + 1;
            }else{
                end = mid;
            }
        }
        return start;
    }