比如,当前遍历到的元素是5,则把它放在nums[4]这个位置。最后再遍历数组,找到第一个没有被正确放置的位置的索引idx,返回idx+1。
Last updated 4 years ago
Was this helpful?