Search⌘ K
AI Features

Solution: Kth Missing Positive Number

Explore how to identify the kth missing positive number from a strictly increasing array with an efficient binary search technique. Understand the logic that connects array indices to missing counts, enabling a fast O(log n) solution with minimal space usage.

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