Problem of the day
The first and only line of each test case consists of Linked list elements of length n (separated by space and terminated by -1)
The maximum Number that is formed using the digits present in the linked list.
You do not need to print anything, it has already been taken care of. Just implement the given function.
1 <= N <= 10^6
0 <= data <= 9
Time Limit: 1sec
1 2 2 0 9 -1
92210
The digits that are present in the linked list are : (1, 2, 2, 0, 9 )
So the answer is the maximum of all the numbers that are formed using these digits is 92210.
1 0 0 0 3 -1
31000