leetcode_41. First Missing Positive ? 待解决

来源:互联网 发布:在手机上怎么开淘宝店 编辑:程序博客网 时间:2024/06/05 19:17

Given an unsorted integer array, find the first missing positive integer.

For example,
Given [1,2,0] return 3,
and [3,4,-1,1] return 2.

Your algorithm should run in O(n) time and uses constant space.

提示:提交代码后,需要用简洁的语言解释一下代码思路~ 谢谢

历史题目和总结见公众号「每日一道算法题」

https://leetcode.com/problems/first-missing-positive/description/

思路

原创粉丝点击