暴力解法
class Solution { public List<Integer> findDisappearedNumbers(int[] nums) { List<Integer> list = new ArrayList<>(); int n = nums.length; boolean[] b = new boolean[n + 1]; for(int i : nums){ b[i] = true; } for(int i = 1;i <= n;i++){ if(!b[i]) list.add(i); } return list; } }