fix(curriculum): clean-up Project Euler 261-280 (#42905)

* fix: clean-up Project Euler 261-280

* fix: typo

* fix: typo

* fix: typo
This commit is contained in:
gikf
2021-07-24 09:09:54 +02:00
committed by GitHub
parent f4dc81bce3
commit f93acf28a6
20 changed files with 219 additions and 162 deletions

View File

@ -8,24 +8,24 @@ dashedName: problem-270-cutting-squares
# --description--
A square piece of paper with integer dimensions N×N is placed with a corner at the origin and two of its sides along the x- and y-axes. Then, we cut it up respecting the following rules:
A square piece of paper with integer dimensions $N×N$ is placed with a corner at the origin and two of its sides along the $x$- and $y$-axes. Then, we cut it up respecting the following rules:
We only make straight cuts between two points lying on different sides of the square, and having integer coordinates.
- We only make straight cuts between two points lying on different sides of the square, and having integer coordinates.
- Two cuts cannot cross, but several cuts can meet at the same border point.
- Proceed until no more legal cuts can be made.
Two cuts cannot cross, but several cuts can meet at the same border point.
Counting any reflections or rotations as distinct, we call $C(N)$ the number of ways to cut an $N×N$ square. For example, $C(1) = 2$ and $C(2) = 30$ (shown below).
Proceed until no more legal cuts can be made.
<img class="img-responsive center-block" alt="ways to cut 2x2 square, counting reflections and rotations as distinct" src="https://cdn.freecodecamp.org/curriculum/project-euler/cutting-squares.gif" style="background-color: white; padding: 10px;">
Counting any reflections or rotations as distinct, we call C(N) the number of ways to cut an N×N square. For example, C(1) = 2 and C(2) = 30 (shown below).
What is C(30) mod 108 ?
What is $C(30)\bmod {10}^8$ ?
# --hints--
`euler270()` should return 82282080.
`cuttingSquares()` should return `82282080`.
```js
assert.strictEqual(euler270(), 82282080);
assert.strictEqual(cuttingSquares(), 82282080);
```
# --seed--
@ -33,12 +33,12 @@ assert.strictEqual(euler270(), 82282080);
## --seed-contents--
```js
function euler270() {
function cuttingSquares() {
return true;
}
euler270();
cuttingSquares();
```
# --solutions--