Module first_missing_positive

Source
Expand description

§41. 缺失的第一个正数

难度 困难

给你一个未排序的整数数组,请你找出其中没有出现的最小的正整数。

§示例 1:

输入: [1,2,0]
输出: 3

§示例 2:

输入: [3,4,-1,1]
输出: 2

§示例 3:

输入: [7,8,9,11,12]
输出: 1

See leetcode

Structs§

Solution