public int firstMissingPositive(int[] A) {

        for (int i = 0; i < A.length; i++) {
            //since the array start from 0, A[i] will be put in i position
            while (A[i] != i + 1) {
                //think about the nagetive & 0 number, out of the length, and duplicate number
                if (A[i] <= 0 || A[i] > A.length || A[i] == A[A[i] - 1]) {
                    break;
                }
                //swap, put the number into the "A[i]" position -> also the "A[A[i]-1]" position
                int temp = A[i];
                A[i] = A[temp - 1];
                A[temp - 1] = temp;
            }
        }

        for (int i = 0; i < A.length; i++) {
            //find the number, just like find the position which not have its own number
            if (A[i] != i + 1) {
                return i + 1;
            }
        }
        //if all numbers are in the array, that will be the next number out of lists
        return A.length + 1;
    }