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 artee2025
"use strict";
function mostNumbers(){
let r = Math.max(...arguments) - Math.min(...arguments);
return isFinite(r) ? r : 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!");
}
April 11, 2018
Comments: