Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Sort number in descending order

function solution(n) {
    return parseInt(n.toString().split('').sort((val1,val2) => val2-val1).join(''));
}

Source by programmers.co.kr #
 
PREVIOUS NEXT
Tagged: #Sort #number #descending #order
ADD COMMENT
Topic
Name
1+1 =