This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html prefix="og: http://ogp.me/ns#"> | |
<head> | |
<!-- content-type, which overrides http equivalent header. Because of charset, this meta should be set at first. --> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> | |
<!-- Overrides http equivalent header. This tells IE to use the most updated engine. --> | |
<meta http-equiv="X-UA-Compatible" content="IE=Edge"> | |
<!-- Tells crawlers how to crawl this page, and the role of this page. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta --> | |
<meta name="robots" content="index, follow"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// write a function that given a list of non negative integers, arranges them | |
// such that they form the largest possible number. | |
// [50, 2, 1, 9] -> 95021 | |
function arrange(array) { | |
array.sort(function(a, b) { | |
return String(a) < String(b); | |
}); | |
return parseInt(array.join('')); | |
} |