Given a sorted array of positive integers, return the k-th missing positive number. The array order allows a direct count of gaps, which is a partial-selection style search problem.
arr = sorted array of positive integers, k = missing index
the k-th missing positive integer
Example 1:
Input:
arr = [2,3,4,7,11] k = 5
Output:
9
Explanation:
The missing positives are 1,5,6,8,9, so the fifth is 9.
Example 2:
Input:
arr = [1,2,3,4] k = 2
Output:
6
Explanation:
The missing positives start at 5, so the second is 6.