文章目录 题目地址题目描述思路题解 题目地址
https://leetcode-cn.com/problems/first-missing-positive/
题目描述
Given an unsorted integer array nums, find the smallest missing positive integer.
Follow up: Could you implement an algorithm that runs in O(n)…
Problem:Given an unsorted integer array, find the smallest missing positive integer. Note:
Your algorithm should run in O(n) time and uses constant extra space.
Solve:(复杂度为O(nlogn)) Thought:由于所给的列表为无序列表&am…