-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprogram63.java
More file actions
58 lines (34 loc) · 1.07 KB
/
program63.java
File metadata and controls
58 lines (34 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
448. Find All Numbers Disappeared in an Array
Easy
8.4K
433
Companies
Given an array nums of n integers where nums[i] is in the range [1, n], return an array of all the integers in the range [1, n] that do not appear in nums.
Example 1:
Input: nums = [4,3,2,7,8,2,3,1]
Output: [5,6]
Example 2:
Input: nums = [1,1]
Output: [2]
*/
package LeetCode;
import java.util.List;
import java.util.ArrayList;
import java.util.Arrays;
public class program63 {
static List<Integer> findDisappearedNumbers(int[] nums) {
List<Integer>ls = new ArrayList<Integer>();
Arrays.sort(nums);
int n = 1;
for(int i=1;i<nums.length;i++){
}
return ls;
}
public static void main(String[] args) {
int[] nums = {4,3,2,7,8,2,3,1};
List<Integer>ls = new ArrayList<Integer>();
ls = findDisappearedNumbers(nums);
System.out.print(ls+" ");
}
}