```
1) nums[i] != nums[nums[i]-1]
2) i != nums[i]-1

```

There is any difference between 1) and 2)?
I can't figure it out any difference btw them, but Instead of 1) , if I have code 2), program have error.

Here is brief explanation of my problem.
This is coding problem which finding all missing numbers in an unsorted array which containing numbers taken from the range 1 to n. The array can have duplicates, so it means soome numbers will be missing. ( - which I want to get.)

```
Input: [2, 3, 1, 8, 2, 3, 5, 1] Output: 4, 6, 7 
The array should have all numbers from 1 to 8, due to duplicates 4, 6, and 7 are missing.

```

I know that there are definitely more efficient solutions for this problem, but here I want to solve this using cyclic sort pattern, 
which using the fact that

> 
> In this problem, the numbers are ranged from '1' to 'n', so we
>  can place each number at its correct place. for example, index 0 :
>  1 / index 1: 2 / index 2: 3.... so on.
> 
> 
> 
> ```
> public static List<Integer> findNumbers(int[] nums) {
> int i = 0;
> while (i < nums.length) {
>   if (nums[i] != nums[nums[i] - 1])
>     swap(nums, i, nums[i] - 1);
>   else
>     i++;
> }
> 
> List<Integer> missingNumbers = new ArrayList<>();
> for (i = 0; i < nums.length; i++)
>   if (nums[i] != i + 1)
>     missingNumbers.add(i + 1);
> 
> return missingNumbers;   }
> 
> ```
> 
> 

So back to my question I cant find any difference btw 1) and 2). 
Cause always index 0 should have 1, index 1 should have 2, index 2 should have 3. so that I think i can simply use the pattern : 2) i != nums[i]-1 instead of 1). 

Did I miss something?