Input: [1,2,3,4,5,6,7] and _k_ = 3 Output: [5,6,7,1,2,3,4] Explanation: rotate 1 steps to the right: [7,1,2,3,4,5,6] rotate 2 steps to the right: [6,7,1,2,3,4,5 ...
// 解答:{4,5,6,1,2,3},nums[mid]=6,low=mid+1,刚好nums[low]=1 // 继续疑问:上边的解释太牵强了,难道没有可能low=mid+1,正好错过了最小值 // 继续解答:不会错过!!! 如果nums[mid]是最小值的话,则其一定小于nums[high],走if,就不会走else了 low = mid+1; // 疑问:为什么while的条件 ...
一些您可能无法访问的结果已被隐去。
显示无法访问的结果