Search⌘ K
AI Features

Solution: Kth Missing Positive Number

Let's solve the Kth Missing Positive Number problem using the Modified Binary Search pattern.

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