File tree 1 file changed +0
-20
lines changed
src/main/java/com/fishercoder/solutions
1 file changed +0
-20
lines changed Original file line number Diff line number Diff line change 2
2
3
3
import java .util .Arrays ;
4
4
5
- /**
6
- * 645. Set Mismatch
7
- *
8
- * The set S originally contains numbers from 1 to n.
9
- * But unfortunately, due to the data error, one of the numbers in
10
- * the set got duplicated to another number in the set,
11
- * which results in repetition of one number and loss of another number.
12
-
13
- Given an array nums representing the data status of this set after the error.
14
- Your task is to firstly find the number occurs twice and then find the number
15
- that is missing. Return them in the form of an array.
16
-
17
- Example 1:
18
- Input: nums = [1,2,2,4]
19
- Output: [2,3]
20
-
21
- Note:
22
- The given array size will in the range [2, 10000].
23
- The given array's numbers won't have any order.
24
- */
25
5
public class _645 {
26
6
public static class Solution1 {
27
7
public int [] findErrorNums (int [] nums ) {
You can’t perform that action at this time.
0 commit comments