登录
注册
写文章
首页
下载APP
会员
IT技术
【Leetcode】41. First Missing Positive
云端漫步_b5aa
关注
赞赏支持
【Leetcode】41. First Missing Positive
要需要swap的两个数不能相等,不然就死循环了
第二个红框是num-1,不要写成num了
Time complexity: O(n)
Space complexity: O(1)
最后编辑于 :
2020.03.30 03:22:31
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
推荐阅读
更多精彩内容
LeetCode 41 [First Missing Positive]
原题 给出一个无序的正数数组,找出其中没有出现的最小正整数。 如果给出 [1,2,0], return 3 如果给...
Jason_Yuan
阅读 1,743
评论 0
赞 0
[LeetCode] 41. First Missing Positive
Given an unsorted integer array, find the first missing p...
xxx亦凡桑
阅读 318
评论 0
赞 0
LeetCode 41: First Missing Positive
标签:数组,难 问题描述 Given an unsorted integer array, find the sm...
二进制研究员
阅读 445
评论 0
赞 0
Leetcode #41 First Missing Positive
思路## 第一个for循环遍历数组,将每个数组放到该放的位置,如nums[1,3,5,2],遍历数组后得到nums...
尴尴尬尬先生
阅读 233
评论 0
赞 0
LeetCode 41. First Missing Positive(缺失的第一个正数 java)
给定一个未排序的整数数组,找出其中没有出现的最小的正整数。 示例 : 输入: [1,2,0]输出: 3输入: [3...
烛火的咆哮
阅读 424
评论 1
赞 0
赞
1赞
赞赏
手机看全文