Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let d = 0;
- for (let i = 1n; i < 100n; ++i) {
- let x = 1n;
- for (let j = 1; j < 100; j++) {
- x *= i;
- d = Math.max(d, x.toString().split("").reduce((a, b) => a + parseInt(b), 0));
- }
- }
- console.log(d);
Advertisement
Add Comment
Please, Sign In to add comment