Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for [old] The Most Numbers by Sim0000
"use strict";
function mostNumbers(){
return arguments.length ? Math.max.apply(null, arguments) - Math.min.apply(null, arguments) : 0;
}
var assert = require('assert');
if (!global.is_checking) {
assert.equal(mostNumbers(1, 2, 3), 2, "3-1=2");
assert.equal(mostNumbers(5, -5), 10, "5-(-5)=10");
assert.equal(Math.round(mostNumbers(10.2, -2.2, 0, 1.1, 0.5)*1000), 12400, "10.2-(-2.2)=12.4");
assert.equal(mostNumbers(), 0, "Empty");
console.log("Coding complete? Click 'Check' to review your tests and earn cool rewards!");
}
Nov. 30, 2016
Comments: