Search⌘ K
AI Features

Solution: Kth Missing Positive Number

Explore how to identify the kth missing positive number in a strictly increasing array by applying a modified binary search. Understand the key insight that links array values and indices to count missing numbers, and learn to implement a solution with optimal time and space efficiency.

Statement

Given a strictly increasing array arr of positive integers and a positive integer k, return the kthk^{th} positive integer that is missing from arr.

Constraints:

  • 11 \leq arr.length 103\leq 10^3 ...