Find the kth missing positive integer from a sorted array of distinct positive integers.

Input: arr=[2,3,4,7,11], k=5 → Output: 9 Input: arr=[1,2,3,4], k=2 → Output: 6

Binary search: at index i, missing count = arr[i]-(i+1). Find first index where missing >= k.

public int findKthPositive(int[] arr, int k) { int left = 0, right = arr.length; while (left < right) { int mid = (left + right) / 2; if (arr[mid] - (mid + 1) < k) left = mid + 1; else right = mid; } return left + k; }