 All Problems
Kth Missing Positive Number
easy
binary search
arrays
amazon
google
facebook

Given a strictly increasing array arr of positive integers and a positive integer k, return the k-th missing positive number.

Example 1:

Input: 2 3 4 7 11
k: 5
Output: 9

Example 2:

Input: 1 2 3 4
k: 2
Output: 6

Input format: Line 1: space-separated sorted array. Line 2: k.

Output format: k-th missing positive integer.

Run to check your code against the sample cases, or submit to run every case