The first line of input contains an integer 'T' representing the number of test cases or queries to be processed. Then the test case follows.
The first line of each test case contains a single integer ‘N’ denoting the number of digits.
The second line of each test case contains ‘N’ single space-separated non-negative integers representing the digits.
For each test case, print the password.
Print the output of each test case in a separate line.
Note :
You do not need to print anything; it has already been taken care of. Just implement the function.
1 <= T <= 100
2 <= N <= 5000
0 <= DIGITS[i] <= 9
Where ‘N’ is the number of digits
Time Limit: 1sec
To find the two numbers that add up to the minimum sum, we take into account the following points -
Here is the complete approach -
The main idea behind this approach is that since ‘DIGITS’ contains values only from 0-9, we can store their count instead of sorting the entire array.
Here is the complete algorithm: