Say you have an array of positive integers, manipulate them so that the concatenation of the integers of the resultant array is the largest number possible. Ex: {9,1,95,17,5}, r
Not sure if anyone is looking for a JavaScript solution, but if you are, here is the code
function LexicographicSort(input) { return Number( input .sort(function(a, b) { // lexicographic sort return Number("" + b + a) - Number("" + a + b); }) .join("") ); }