Given an array arr of positive integers sorted in a strictly increasing order, and an integer k.

Return the kth positive integer that is missing from this array.

&nbsp;
Example 1:

Input: arr = [2,3,4,7,11], k = 5
Output: 9
Explanation: The missing positive integers are [1,5,6,8,9,10,12,13,...]. The 5th&nbsp;missing positive integer is 9.


Example 2:

Input: arr = [1,2,3,4], k = 2
Output: 6
Explanation: The missing positive integers are [5,6,7,...]. The 2nd missing positive integer is 6.


&nbsp;
Constraints:


	1 &lt;= arr.length &lt;= 1000
	1 &lt;= arr[i] &lt;= 1000
	1 &lt;= k &lt;= 1000
	arr[i] &lt; arr[j] for 1 &lt;= i &lt; j &lt;= arr.length


&nbsp;
Follow up:

Could you solve this problem in less than O(n) complexity?

class Solution:
    def findKthPositive(self, arr: List[int], k: int) -> int:
        arr = set(arr)
        i = 0
        missed = 0
        while missed != k:
            i += 1
            if i not in arr:
                missed += 1
        return i
class Solution {
    public int findKthPositive(int[] arr, int k) {
        if(arr[0] > k) {
            return k;
        }
        
        for(int i=0; i<arr.length; i++) {
            if(arr[i] <= k) {
                k++;
            }else {
                break;
            }
        }
        return k;
    }
}
class Solution {
public:
    int findKthPositive(vector<int>& arr, int k) {

    int n=arr.size();
    if(arr[n-1]==n)
        return n+k;
    else
    {
        int start=0;
        int end=n-1;
        int ans;
        while(start<=end)
        {
            int mid=start+(end-start)/2;
            if((arr[mid]-(mid+1))<k)
                start=mid+1;
            else
                end=mid-1;
        }
        return start+k;
    }

    }
};
var findKthPositive = function(arr, k) {
    let newArr = [];
    for(let i=0,j=1; j<=arr.length+k; j++){
        arr[i]!=j?newArr.push(j):i++;
    }
    return newArr[k-1]; 
    
};
Kth Missing Positive Number