Files
codewars/integer-depth/index.js
2019-12-07 23:14:46 +01:00

11 lines
227 B
JavaScript

// https://www.codewars.com/kata/integer-depth/javascript
function computeDepth(x) {
const d = new Set();
for (let i = 1;; ++i) {
[...(x*i + '')].map(n => d.add(n));
if (d.size === 10) return i;
}
return 10;
}