Practice Real Company Assessment Patterns • Latest 2025–2026 Mock Tests

Programming Exercises

Write a function to find the smallest positive integer missing from an unsorted list of numbers.

Hard

Problem Statement

Write a function to find the smallest positive integer missing from an unsorted list of numbers.

Sample Input

[3, 4, -1, 1]

Sample Output

2

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
def smallest_missing_positive(): lst = [3, 4, -1, 1] # Your code here return
Log in or sign up to run or submit your code.Log inSign up
Input
[3, 4, -1, 1]
Expected Output
2