This repository has been archived on 2024-01-26. You can view files and clone it, but cannot push or open issues or pull requests.
project-euler/1/euler001.js
2017-07-04 00:13:17 +02:00

8 lines
166 B
JavaScript
Executable file

#!/usr/bin/node
console.log(
[...Array(999).keys()]
.filter( x => (x+1) % 3 == 0 || (x+1) % 5 == 0)
.reduce( (sum, x) => sum + x + 1)
+ 1
);