Make a Permutation

All submissions for this problem are available.
###Read problems statements [Bengali](http://www.codechef.com/download/translated/COOK98/bengali/MAKPERM.pdf) , [Mandarin chinese](http://www.codechef.com/download/translated/COOK98/mandarin/MAKPERM.pdf) , [Russian](http://www.codechef.com/download/translated/COOK98/russian/MAKPERM.pdf) and [Vietnamese](http://www.codechef.com/download/translated/COOK98/vietnamese/MAKPERM.pdf) as well. You are given an integer sequence $A$ with length $N$. In one move, you are allowed to choose one element of this sequence and change it to an arbitrary integer. Compute the minimum number of moves needed to make the sequence a permutation of the integers $1$ through $N$. ### Input  The first line of the input contains a single integer $T$ denoting the number of test cases. The description of $T$ test cases follows.  The first line of each test case contains a single integer $N$.  The second line contains $N$ spaceseparated integers $A_1, A_2, \dots, A_N$. ### Output For each test case, print a single line containing one integer — the minimum required number of moves. ### Constraints  $1 \le T \le 100$  $1 \le N \le 10^5$  the sum of $N$ for all test cases does not exceed $2 \cdot 10^5$  $1 \le A_i \le 10^9$ for each valid $i$ ### Example Input ``` 2 4 1 2 3 3 3 2 6 2 ``` ### Example Output ``` 1 2 ``` ### Explanation **Example case 1:** One possible way is to change the last element to $4$. This creates the sequence $1, 2, 3, 4$, which is a permutation. **Example case 2:** We can change the first element to $1$ and the second element to $3$, creating the permutation $1, 3, 2$.Author:  kingofnumbers 
Tags  cook98, kingofnumbers, observations, permutation, simple, taran_1407 
Date Added:  21092018 
Time Limit:  1 sec 
Source Limit:  50000 Bytes 
Languages:  C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, kotlin, PERL6, TEXT, SCM chicken, PYP3, CLOJ, COB, FS 
Comments
 Please login at the top to post a comment.
SUCCESSFUL SUBMISSIONS
Fetching successful submissions