Skip to content
This repository has been archived by the owner on Dec 24, 2020. It is now read-only.

Commit

Permalink
Updated the solutions for "Puzzled Programmers" puzzle #5
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffpar committed Sep 21, 2017
1 parent 72a0ea6 commit c768435
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions tests/node/puzzled/puzzle5.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,11 @@ function run() {
p[d] = Math.pow(d, power);
}
let n = start;
let m = (n / 10)|0;
while (true) {
let sum = sumPowers(m);
let sum = sumPowers(n);
for (let d = 0; d <= 9; d++) {
if (sum + p[d] == n + d) console.log(n + d);
}
m += 1;
n += 10;
if (n >= end) break;
}
Expand Down

0 comments on commit c768435

Please sign in to comment.