Given an array of positive integers of size N. The task is to make a sorted array which will contain all distinct digits present in A.
The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. Each test case contains two lines, first line containing an integer N size of array, and second line containing the array elements.
For each test case, print the required array.
1 <= T <= 100
1 <= N <= 107
1 <= Ai <= 1016
131 11 48
111 222 333 446
1 3 4 8
1 2 3 4 6
Testcase 1: 1, 3, 4, and 8 are only distinct digits that can be extracted from the numbers of the array.
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.