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

class Solution {
  public List<Integer> findDisappearedNumbers(int[] nums) {
    List<Integer> result = new ArrayList<>(nums.length);

    for (int i = 0; i < nums.length; i++) {
      if (nums[i] != nums[nums[i]-1]) {
        swap(nums, i, nums[i]-1);
      }
    }
    for (int i = 0; i < nums.length; i++) {
      if (nums[i] != nums[nums[i]-1]) {
        result.add(i);
      }
    }
    return result;
  }

  private void swap(int[] nums, int x, int y) {
    int temp = nums[x];
    nums[x] = nums[y];
    nums[y] = temp;
  }
}
@@ -228,95 +228,202 @@
 ) %7B%0A
+%09
     
-  if (nums%5Bi%5D != nums%5Bnums%5Bi%5D-1%5D) %7B%0A        swap(nums, i, nums%5Bi%5D-1);%0A      %7D%0A    %7D
+// %E7%AC%ACi%E4%B8%AA%E6%95%B0%E7%9A%84%E5%80%BC%E6%89%80%E8%A1%A8%E7%A4%BA%E7%9A%84%E4%BD%8D%E7%BD%AE%EF%BC%8C%E5%B0%86%E5%AE%83%E8%AE%BE%E4%B8%BA%E8%B4%9F%E7%9A%84%E3%80%82%0A%09    int position = Math.abs(nums%5Bi%5D) - 1;%0A%09    if (nums%5Bposition%5D %3E 0) %7B%0A%09%09    nums%5Bposition%5D = -nums%5Bposition%5D;%0A      %7D%0A    %7D%0A%09  // %E5%88%B0%E6%9C%80%E5%90%8E%EF%BC%8C%E5%A6%82%E6%9E%9C%E7%BC%BA%E5%B0%91%E5%93%AA%E4%BA%9B%E6%95%B0%EF%BC%8C%E9%82%A3%E4%B9%88%E8%BF%99%E4%BA%9B%E6%95%B0%E6%89%80%E6%8C%87%E5%90%91%E7%9A%84%E4%BD%8D%E7%BD%AE%E7%9A%84%E5%80%BC%E5%B0%B1%E6%B2%A1%E6%9C%89%E6%9B%B4%E6%94%B9%E8%BF%87
 %0A   
@@ -459,26 +459,25 @@
 gth; i++) %7B%0A
-  
+%09
     if (nums
@@ -484,34 +484,17 @@
 %5Bi%5D 
-!= nums%5Bnums%5Bi%5D-1%5D) %7B%0A    
+%3E 0) %7B%0A%09%09
     
@@ -505,16 +505,20 @@
 lt.add(i
+ + 1
 );%0A     
@@ -552,126 +552,6 @@
 %0A  %7D
-%0A%0A  private void swap(int%5B%5D nums, int x, int y) %7B%0A    int temp = nums%5Bx%5D;%0A    nums%5Bx%5D = nums%5By%5D;%0A    nums%5By%5D = temp;%0A  %7D
 %0A%7D

complete find disappeared numbers