Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
MD - SLR - Math.max, InterpString, Split, Spread, Map solution in Clear category for Max Digit by Taylor_Page
import assert from "assert";
//const maxDigit = (value: number): number => Math.max(...`${value}`.split("").map(Number))
function maxDigit(value: number): number {
return Math.max(...`${value}`.split("").map(Number))
}
console.log('Example:');
console.log(maxDigit(0));
// These "asserts" are used for self-checking
assert.equal(maxDigit(0), 0);
assert.equal(maxDigit(52), 5);
assert.equal(maxDigit(634), 6);
assert.equal(maxDigit(1), 1);
assert.equal(maxDigit(10000), 1);
console.log("Coding complete? Click 'Check' to earn cool rewards!");
April 29, 2020
Comments: