MCPcopy Create free account
hub / github.com/LjyYano/LeetCode / L0041_FirstMissingPositive

Class L0041_FirstMissingPositive

src/main/java/L0041_FirstMissingPositive.java:22–81  ·  view source on GitHub ↗

题目链接:https://leetcode.cn/problems/first-missing-positive/ 给你一个未排序的整数数组 nums,请你找出其中没有出现的最小的正整数。 请你实现时间复杂度为 O(n) 并且只使用常数级别额外空间的解决方案。 示例 1: 输入:nums = [1,2,0] 输出:3 解释:数字 1 和 2 都出现了,所以最小的缺失正数是 3 示例 2: 输入:nums = [3,4,-1,1] 输出:2 解释:数字 1、3、4 都出现了,所以最小的缺失正数是 2 示例 3: 输入:nums = [7,8,9,11,12] 输出:1 解释:最小的正数

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected