bad tests


  • 0
    A

    O(n) solutions works great with such search of pivot

    private int findPivot(int[] nums, int from, int to) {
            int minInd = 0;
            int min = nums[0];
            for (int i = from; i <= to; i++) {
                if (nums[i] < min) {
                    min = nums[i];
                    minInd = i;
                }
            }
            return minInd;
        }
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.