Files
freeCodeCamp/curriculum/challenges/english/10-coding-interview-prep/project-euler/problem-364-comfortable-distance.md
Oliver Eyton-Williams ee1e8abd87 feat(curriculum): restore seed + solution to Chinese (#40683)
* feat(tools): add seed/solution restore script

* chore(curriculum): remove empty sections' markers

* chore(curriculum): add seed + solution to Chinese

* chore: remove old formatter

* fix: update getChallenges

parse translated challenges separately, without reference to the source

* chore(curriculum): add dashedName to English

* chore(curriculum): add dashedName to Chinese

* refactor: remove unused challenge property 'name'

* fix: relax dashedName requirement

* fix: stray tag

Remove stray `pre` tag from challenge file.

Signed-off-by: nhcarrigan <nhcarrigan@gmail.com>

Co-authored-by: nhcarrigan <nhcarrigan@gmail.com>
2021-01-12 19:31:00 -07:00

1.0 KiB

id, title, challengeType, forumTopicId, dashedName
id title challengeType forumTopicId dashedName
5900f4d91000cf542c50ffea Problem 364: Comfortable distance 5 302025 problem-364-comfortable-distance

--description--

There are N seats in a row. N people come after each other to fill the seats according to the following rules:

If there is any seat whose adjacent seat(s) are not occupied take such a seat.

If there is no such seat and there is any seat for which only one adjacent seat is occupied take such a seat.

Otherwise take one of the remaining available seats.

Let T(N) be the number of possibilities that N seats are occupied by N people with the given rules. The following figure shows T(4)=8.

We can verify that T(10) = 61632 and T(1 000) mod 100 000 007 = 47255094. Find T(1 000 000) mod 100 000 007.

--hints--

euler364() should return 44855254.

assert.strictEqual(euler364(), 44855254);

--seed--

--seed-contents--

function euler364() {

  return true;
}

euler364();

--solutions--

// solution required