bars
📈
notes
search
circle-xmark
⌘
Ctrl
k
copy
Copy
chevron-down
0041_First_Missing_Positive
思路1 把数组中的正数按数值重新放在数组中
比如,当前遍历到的元素是5,则把它放在nums[4]这个位置。最后再遍历数组,找到第一个没有被正确放置的位置的索引idx,返回idx+1。
Previous
0041_First_Missing_Positive
chevron-left
Next
0042_Trapping_Rain_Water
chevron-right
Last updated
5 years ago