Problem Challenge 2

Find the Smallest Missing Positive Number (medium) #

Given an unsorted array containing numbers, find the smallest missing positive number in it.

Example 1:

Input: [-3, 1, 5, 4, 2]
Output: 3
Explanation: The smallest missing positive number is '3'

Example 2:

Input: [3, -2, 0, 1, 2]
Output: 4

Example 3:

Input: [3, 2, 5, 1]
Output: 4

Try it yourself #

Try solving this question here:

0 of 3 Tests Passed
ResultInputExpected OutputActual OutputReason
findNumber([-3, 1, 5, 4, 2])3-1Incorrect Output
findNumber([3, -2, 0, 1, 2])4-1Incorrect Output
findNumber([3, 2, 5, 1])4-1Incorrect Output
8.105s
Mark as Completed
←    Back
Solution Review: Problem Challenge 1
Next    →
Solution Review: Problem Challenge 2