Kth Missing Positive Number

Given a strictly increasing array arr of positive integers and a positive integer k, return the kth positive integer that does not appear in arr.

Given a strictly increasing array `arr` of positive integers and a positive integer `k`, return the `k`th positive integer that does not appear in `arr`.

- `1 <= arr.length <= 20` - `1 <= arr[i] <= 100` - `arr` is strictly increasing - `1 <= k <= 50`

Example 1: input arr = [2,3,4,7,11], k = 5; output 9. The missing positives are 1, 5, 6, 8, 9, ...; the fifth is 9.

Example 2: input arr = [1,2,3,4], k = 2; output 6. The first two missing positives are 5 and 6.

Category: Binary Search. Topic: binary-search. Difficulty: Easy. Patterns: binary-search.