Maximum Number

5

1 votes
Easy-Medium
Problem

Given an array of numbers, arrange them in a way that yields the largest value. For example, if the given numbers are {54, 546, 548, 60}, the arrangement 6054854654 gives the largest value.

input:
First line contains an integer N , Next line contains N integers separated by space.

output:
Print the maximum number that can be obtained by using given numbers.

Constraints:
1<=N<=1000
1<=Number<=1000000

Time Limit: 5
Memory Limit: 256
Source Limit:
Editor Image

?