Loading...

The Missing Number

A easy Python interview practice problem on DataDriven. Write and execute real python code with instant grading.

Domain
Python
Difficulty
easy
Seniority
junior

Problem

Our ID allocation system needs to find gaps in assigned ID sequences. Write a function called nth_missing that takes a sorted list of unique positive integers and an integer n, and returns the nth positive integer not in the list.

Practice This Problem

Solve this Python problem with real code execution. DataDriven runs your Python code in a sandboxed Docker environment and grades it instantly.