FrankKair / polyglot-euler

📜 Project Euler solutions in various programming languages
MIT License
74 stars 14 forks source link

Go 005 #53

Closed FrankKair closed 6 years ago

FrankKair commented 6 years ago

How the solution works

The smallest divisible number by a range from 1 to 20, is the lcm of the accumulated number.

(1..19).reduce { |acc, x| acc.lcm(x) }

Performance

Go

Real time: 0.541 s
User time: 0.145 s
Sys. time: 0.184 s
CPU share: 60.84 %