@@ -0,0 +1,1133 @@
+// Given an unsorted integer array, find the first missing positive integer.%0A%0A// For example,%0A// Given %5B1,2,0%5D return 3,%0A// and %5B3,4,-1,1%5D return 2.%0A%0A// Your algorithm should run in O(n) time and uses constant space.%0A%0Apublic class Solution %7B%0A%09// Find the first missing positive integer, meaning we %0A%09// should start checking from 1, and for an input %0A%09// array of size N, the missing integer should not be%0A%09// larger than N+1.%0A%09// For example: A = %7B1,2,3%7D N = 3, we have N+1 = 4 missing%0A%09// with elements in A being all increasing integers starting%0A%09// with 1. If A = %7B1,2, 130%7D. 3 is missing. So we just need%0A%09// to map all values in A to a similar size array.%0A    public int firstMissingPositive(int%5B%5D A) %7B%0A    %09int len = A.length;%0A    %09if(len == 0) return 1;%0A%0A    %09int%5B%5D dp = new int%5Blen + 1%5D;%0A%0A    %09for(int i = 0; i %3C len; i++)%7B%0A    %09%09if(A%5Bi%5D %3E 0 && A%5Bi%5D %3C= len)%7B%0A    %09%09%09dp%5BA%5Bi%5D%5D = 1;%0A    %09%09%7D%0A    %09%7D%0A%0A    %09int miss = 1;%0A%0A    %09for(int i = 1; i %3C= len; i++)%7B%0A    %09%09if(dp%5Bi%5D == 0)%7B%0A    %09%09%09miss = i;%0A    %09%09%09break;%0A    %09%09%7D%0A%0A    %09%09if(dp%5Bi%5D == 1 && i == len)%7B%0A    %09%09%09miss = i + 1;%0A    %09%09%09break;%0A    %09%09%7D%0A    %09%7D%0A%0A    %09return miss;%0A    %7D%0A%7D

add first missing positive interger solution