https://leetcode.cn/problems/first-missing-positive/description/?envType=study-plan-v2&envId=top-100-liked
置换
class Solution {public int firstMissingPositive(int[] nums) {int len=nums.length;//nums[i]属于[1,len]for(int i=0;i<len;i++){while(nums[i]>=1&&nums[i]<=len&&nums[i]!=nums[nums[i]-1]){int tmp=nums[nums[i]-1];nums[nums[i]-1]=nums[i];nums[i]=tmp;}}for(int i=0;i<len;i++){if(i!=(nums[i]-1)){return i+1;}}return len+1;}
}