Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
The need for speedy solution. solution in Clear category for [old] Digits Multiplication by CptDemocracy
"use strict";
function digitsMultip(data) {
return parseInt(data
.toString()
.split("")
.filter(a => a != "0")
.reduce((a, b) => parseInt(a) * parseInt(b) ));
}
var assert = require('assert');
if (!global.is_checking) {
assert.equal(digitsMultip(123405), 120, "1st");
assert.equal(digitsMultip(999), 729, "2nd");
assert.equal(digitsMultip(1000), 1, "3rd");
assert.equal(digitsMultip(1111), 1, "4th");
console.log("Coding complete? Click 'Check' to review your tests and earn cool rewards!");
}
Aug. 15, 2016
Comments: