You are viewing a single comment's thread. Return to all comments →
JS
function superDigit(n, k) { let sum = n.split('').reduce((a, s) => a + Number(s), 0); let next = (sum * k) + ""; return (next.length == 1) ? Number(next) : superDigit(next, 1); }
Seems like cookies are disabled on this browser, please enable them to open this website
Super Digit
You are viewing a single comment's thread. Return to all comments →
JS