First K natural numbers
Submissions: 1963   Accuracy:

26.44%

  Difficulty: Basic   Marks: 1

Given an array of size n and a number k, we need to print first k natural numbers that are not there in given array.

Input:
First line consists of T test case. First line of every test case consists of N and K. Second line consists of elements of array.

Output:
Single line output, print the K missing numbers.

Constraints:
1<=T<=100
1<=N<=10^4
-1000<=Ai<=1000

Example:
Input:

2
3 3
1 4 3
3 3
-5 -6 1
Output:
2 5 6 
2 3 4 

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Saksham Raj Seth
Author: saksham seth


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.


to report an issue on this page.