-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8d5d46b
commit 0169ff3
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
A number of balls are kept in a basket each named in the range [1,n]. some students picked few balls randomly and changed their numbers to existing numbers in the box and then added back. Now box has unique numbers + duplicate numbers. Find the original numbers on the balls whose numbers were changed. | ||
|
||
Input variables:- | ||
int t: no. of test cases | ||
int n: range | ||
int arr[]: array conatining the original and duplicate numbered balls | ||
|
||
Input Description: | ||
-First line of input consists of t, the number of test cases | ||
-Next each lines consist of n the range | ||
-Next line consist of the array conatining the original and duplicate numbered balls | ||
|
||
Output Description:- | ||
Print the balls whose numbers were changed | ||
|
||
Constraints:- | ||
-> 1<=t,n<=10 | ||
->1<= value of each array element <=10 | ||
|
||
Sample Input: | ||
2 | ||
4 | ||
[4,3,2,7,8,2,3,1] | ||
2 | ||
[1,1] | ||
|
||
Sample Output: | ||
5,6 | ||
2 |