@@ -0,0 +1,642 @@
+package leetcode;%0A%0Apublic class Task1539 %7B%0A%0A    public static void main(String%5B%5D args) %7B%0A        System.out.println(new Task1539().findKthPositive(new int%5B%5D%7B2, 3, 4, 7, 11%7D, 5));%0A        System.out.println(new Task1539().findKthPositive(new int%5B%5D%7B1, 2, 3, 4%7D, 2));%0A    %7D%0A%0A    public int findKthPositive(int%5B%5D arr, int k) %7B%0A        int missed = 0;%0A        int foundIndex = 0;%0A        for (int i = 1; ; i++) %7B%0A            if (i == arr%5BMath.min(foundIndex, arr.length - 1)%5D) %7B%0A                foundIndex++;%0A            %7D else %7B%0A                if (++missed == k) %7B%0A                    return i;%0A                %7D%0A            %7D%0A        %7D%0A    %7D%0A%7D%0A

Add Task1539