Skip to content

Commit

Permalink
Add docs for new rust solutions
Browse files Browse the repository at this point in the history
  • Loading branch information
LivInTheLookingGlass committed Jul 18, 2024
1 parent 8a58d06 commit 3637e3e
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 6 deletions.
15 changes: 9 additions & 6 deletions docs/rust/p0003.rst
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
Rust Implementation of Problem 4
Rust Implementation of Problem 3
================================

View source code `here on GitHub! <https://github.com/LivInTheLookingGlass/Euler/blob/master/rust/src/p0004.rs>`_
View source code `here on GitHub! <https://github.com/LivInTheLookingGlass/Euler/blob/master/rust/src/p0003.rs>`_

Includes
--------

- `primes <./primes.html>`_

Problem Solution
----------------

.. rust:fn:: p0004::is_palindrome(x: u64) -> bool
.. rust:fn:: p0004::p0004() -> u64
.. rust:fn:: p0003::p0003() -> u64
.. literalinclude:: ../../rust/src/p0004.rs
.. literalinclude:: ../../rust/src/p0003.rs
:language: rust
:linenos:
15 changes: 15 additions & 0 deletions docs/rust/p0004.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Rust Implementation of Problem 4
================================

View source code `here on GitHub! <https://github.com/LivInTheLookingGlass/Euler/blob/master/rust/src/p0004.rs>`_

Problem Solution
----------------

.. rust:fn:: p0004::is_palindrome(x: u64) -> bool
.. rust:fn:: p0004::p0004() -> u64
.. literalinclude:: ../../rust/src/p0004.rs
:language: rust
:linenos:
13 changes: 13 additions & 0 deletions docs/rust/p0005.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Rust Implementation of Problem 5
================================

View source code `here on GitHub! <https://github.com/LivInTheLookingGlass/Euler/blob/master/rust/src/p0005.rs>`_

Problem Solution
----------------

.. rust:fn:: p0005::p0005() -> u64
.. literalinclude:: ../../rust/src/p0005.rs
:language: rust
:linenos:
13 changes: 13 additions & 0 deletions docs/rust/p0006.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Rust Implementation of Problem 6
================================

View source code `here on GitHub! <https://github.com/LivInTheLookingGlass/Euler/blob/master/rust/src/p0006.rs>`_

Problem Solution
----------------

.. rust:fn:: p0006::p0006() -> u64
.. literalinclude:: ../../rust/src/p0006.rs
:language: rust
:linenos:
15 changes: 15 additions & 0 deletions rust/src/p0005.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
Project Euler Problem 5
I solved this problem by testing all combinations of the various multiples. I
actually tried to solve this by hand before doing this, and it wasn't terribly
hard. The answer turns out to be (2**4 * 3**2 * 5 * 7 * 11 * 13 * 17 * 19)
Problem:
2520 is the smallest number that can be divided by each of the numbers from 1
to 10 without any remainder.
What is the smallest positive number that is evenly divisible by all of the
numbers from 1 to 20?
*/
use itertools::Itertools;

pub fn p0005() -> u64 {
Expand Down

0 comments on commit 3637e3e

Please sign in to comment.