Skip to content

Latest commit

 

History

History

Arrange Given Numbers to Form the Biggest Number

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Given an array of non-negative numbers(of Integer Range), they are needed to be arranged in some order such that it gives the max number. For example given array is A[1, 34, 3, 98, 9, 76, 45, 4, 12, 121]. if we arrange these numbers in the following order, A[9, 98, 76, 45, 4, 34, 3, 12, 121, 1], then by joining them we get “99876454343121211” as largest number.

Input :  [1, 34, 3, 98, 9, 76, 45, 4, 12, 121]
Output : 99876454343121211

Input :  [12, 121]
Output : 12121