Smallest Missing Positive Integer

Asked at Goldman Sachs · Coding Questions · Difficulty: Hard · Last asked Jun 9, 2025

Given an unsorted integer array, find the smallest positive integer that does not occur in it. The array may hold negatives, zeros, duplicates and values larger than its length.

Loading the problem…