FrankKair / polyglot-euler

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

some improvements from learning rust #125

Closed yvern closed 4 years ago

yvern commented 4 years ago

Hello! Thank you for your contribution to polyglot-euler.

How the solution works

P001: no need to create iterator, since (1..1000) already returns one, and no need to explicitly borrow/reference

P006: by having the whole state in a tuple, we can iterate only once

Performance

P001: Try it online!

P006:Try it online!