package leetcode;

import java.util.ArrayList;
import java.util.List;

/**
 * https://leetcode.com/problems/find-all-numbers-disappeared-in-an-array/
 */
public class Problem448 {
    public List<Integer> findDisappearedNumbers(int[] nums) {
        // TODO
        return new ArrayList<>();
    }

    public static void main(String[] args) {
        Problem448 prob = new Problem448();
        System.out.println(prob.findDisappearedNumbers(new int[]{4, 3, 2, 7, 8, 2, 3, 1})); // [5, 6]
    }
}

@@ -247,30 +247,30 @@
     
-// TODO%0A        return
+List%3CInteger%3E result =
  new
@@ -293,201 +293,597 @@
     
-%7D%0A%0A
     
-public static void main(String%5B%5D args) %7B%0A        Problem448 prob = new Problem448();%0A        System.out.println(prob.findDisappearedNumbers(new int%5B%5D%7B4, 3, 2, 7, 8, 2, 3, 1%7D)); // %5B5, 6%5D
+for (int i = 0; i %3C nums.length; i++) %7B%0A            if (nums%5Bi%5D != i + 1) %7B%0A                int to = nums%5Bi%5D - 1;%0A                swap(nums, to);%0A            %7D%0A        %7D%0A        for (int i = 0; i %3C nums.length; i++) %7B%0A            if (nums%5Bi%5D != i + 1) %7B%0A                result.add(i + 1);%0A            %7D%0A        %7D%0A        return result;%0A    %7D%0A%0A    private static void swap(int%5B%5D nums, int from) %7B%0A        if (nums%5Bfrom%5D == from + 1) %7B%0A            return;%0A        %7D%0A        int val = nums%5Bfrom%5D;%0A        int to = nums%5Bval - 1%5D;%0A        nums%5Bfrom%5D = from + 1;%0A        swap(nums, val - 1);
 %0A   

Solve problem 448