freeCodeCamp/curriculum/challenges/chinese/08-coding-interview-prep/project-euler/problem-364-comfortable-dis...

1.2 KiB
Raw Blame History

id challengeType title videoUrl localeTitle
5900f4d91000cf542c50ffea 5 Problem 364: Comfortable distance 问题364舒适的距离

Description

连续N个座位。根据以下规则N人互相填充座位如果有任何座位相邻的座位没有被占用请使用这样的座位。如果没有这样的座位并且有任何座位仅占用一个相邻的座位则使用这样的座位。否则请选择剩余的可用座位之一。

设TN是具有给定规则的N个人占用N个座位的可能性的数量。下图显示T4= 8。

我们可以验证T10= 61632和T1 000mod 100 000 007 = 47255094.求T1 000 000mod 100 000 007。

Instructions

Tests

tests:
  - text: <code>euler364()</code>应返回44855254。
    testString: 'assert.strictEqual(euler364(), 44855254, "<code>euler364()</code> should return 44855254.");'

Challenge Seed

function euler364() {
  // Good luck!
  return true;
}

euler364();

Solution

// solution required