@@ -0,0 +1,1290 @@
+package org.pilgrim.leetcode.y2021;%0A%0A/*You have a set of integers s, which originally contains all the numbers from 1 to n. Unfortunately, due to some error, one of the numbers in s got duplicated to another number in the set, which results in repetition of one number and loss of another number.%0A%0AYou are given an integer array nums representing the data status of this set after the error.%0A%0AFind the number that occurs twice and the number that is missing and return them in the form of an array.%0A%0A %0A%0AExample 1:%0A%0AInput: nums = %5B1,2,2,4%5D%0AOutput: %5B2,3%5D%0AExample 2:%0A%0AInput: nums = %5B1,1%5D%0AOutput: %5B1,2%5D%0A %0A%0AConstraints:%0A%0A2 %3C= nums.length %3C= 104%0A1 %3C= nums%5Bi%5D %3C= 104*/%0A%0Apublic class SetMismatch %7B%0A    public int%5B%5D findErrorNums(int%5B%5D nums) %7B%0A        if(nums == null)%7B%0A            return null;%0A        %7D%0A        %0A        int dub = 0;%0A        int mis = 0;%0A        %0A        int%5B%5D all = new int%5Bnums.length%5D;%0A        for(int i=0; i%3Cnums.length; i++)%7B%0A            if(all%5Bnums%5Bi%5D - 1%5D != 0)%7B%0A                dub = nums%5Bi%5D;%0A            %7D%0A            %0A            all%5Bnums%5Bi%5D - 1%5D = 1;%0A        %7D%0A        %0A        for(int i=0; i%3Cnums.length; i++)%7B%0A            if(all%5Bi%5D == 0)%7B%0A                mis = i + 1;%0A                break;%0A            %7D%0A        %7D%0A        %0A        return new int%5B%5D %7Bdub, mis%7D;%0A    %7D%0A%7D

add SetMismatch