Leetcode算法——4一、寻找缺失的正数

给定一个乱序的整数数组,找到最小的缺失的正整数。python 示例:web Example 1: Input: [1,2,0] Output: 3 Example 2: Input: [3,4,-1,1] Output: 2 Example 3: Input: [7,8,9,11,12] Output: 1 思路 一、标记法 若是 nums 的长度为 l,则结果确定是在 1 ~ (l+1) 中
相关文章
相关标签/搜索