Search⌘ K
AI Features

Solution: Kth Missing Positive Number

Explore how to apply modified binary search to find the kth missing positive number in a strictly increasing array. This lesson helps you understand the logic behind missing count calculation and implement an efficient O(log n) algorithm with constant space. Gain skills to handle similar search problems involving missing elements.

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 ...