Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Short solution in Clear category for [old] Binary Count by SaintDron
"use strict";
var binaryCount = (number) => number.toString(2).replace(/0/g, '').length;
var assert = require('assert');
if (!global.is_checking) {
assert.equal(binaryCount(4), 1);
assert.equal(binaryCount(15), 4);
assert.equal(binaryCount(1), 1);
assert.equal(binaryCount(1022), 9);
console.log("Coding complete? Click 'Check' to review your tests and earn cool rewards!");
}
Oct. 16, 2018
Comments: