Statement
Given an unsorted integer array, arr
, of size n and a number k, your task is to find the first k missing positive numbers from the array. If there are less than k missing positive numbers in the array, then add the remaining missing numbers by adding the values after the last value of the array until we have k missing positive numbers. Ignore all negative numbers.
Constraints:
n=arr.length
1≤k≤104
−104≤ arr[i]
≤104
0≤n≤104
Examples