MCPcopy Create free account
hub / github.com/neetcode-gh/leetcode / firstMissingPositive

Function firstMissingPositive

javascript/0041-first-missing-positive.js:8–12  ·  view source on GitHub ↗
(nums)

Source from the content-addressed store, hash-verified

6 * @return {number}
7 */
8var firstMissingPositive = (nums) => {
9 cyclicSort(nums);
10
11 return search(nums);
12};
13
14const cyclicSort = (nums, index = 0) => {
15 while (index < nums.length) {

Callers

nothing calls this directly

Calls 2

cyclicSortFunction · 0.70
searchFunction · 0.70

Tested by

no test coverage detected