What will be the output of the testcase where size of array is 2 and the elements are
1 10
should it be 101 or 110?
Question unclear
The output should be 110.
Here 110> 101 .
Hence, 110 is the largest no.
the question ask you to find the numerically largest sequence amongst all the possible arrangements of the given elements of the array.
example:
input: 1 54 532
possible arrangements:
154532
153254
545321
541532
532154
532541
here, 545321>541532>532541>532154>154532>153254
hence, output is 545321
1 Like