First Missing Positive

Talk it through with a coach who asks guiding questions and gives hints until you reach the answer. Pass to mark the challenge as completed.

The problem

  • hard
  • Pro

Given an unsorted list of integers, find the smallest positive integer that does not appear in it. Do it in linear time using only constant extra memory, and explain your approach.

Talk this problem through with an AI coach

This is a Pro challenge. Sign in with Google, then upgrade to start a voice session.

Start free →