Files
freeCodeCamp/curriculum/challenges/english/10-coding-interview-prep/project-euler/problem-115-counting-block-combinations-ii.english.md
Oliver Eyton-Williams bd68b70f3d Feat: hide blocks not challenges (#39504)
* fix: remove isHidden flag from frontmatter

* fix: add isUpcomingChange

Co-authored-by: Ahmad Abdolsaheb <ahmad.abdolsaheb@gmail.com>

* feat: hide blocks not challenges

Co-authored-by: Ahmad Abdolsaheb <ahmad.abdolsaheb@gmail.com>

Co-authored-by: Ahmad Abdolsaheb <ahmad.abdolsaheb@gmail.com>
2020-09-03 15:07:40 -07:00

1.5 KiB

id, challengeType, title, forumTopicId
id challengeType title forumTopicId
5900f3df1000cf542c50fef1 5 Problem 115: Counting block combinations II 301741

Description

NOTE: This is a more difficult version of Problem 114. A row measuring n units in length has red blocks with a minimum length of m units placed on it, such that any two red blocks (which are allowed to be different lengths) are separated by at least one black square. Let the fill-count function, F(m, n), represent the number of ways that a row can be filled. For example, F(3, 29) = 673135 and F(3, 30) = 1089155. That is, for m = 3, it can be seen that n = 30 is the smallest value for which the fill-count function first exceeds one million. In the same way, for m = 10, it can be verified that F(10, 56) = 880711 and F(10, 57) = 1148904, so n = 57 is the least value for which the fill-count function first exceeds one million. For m = 50, find the least value of n for which the fill-count function first exceeds one million.

Instructions

Tests

tests:
  - text: <code>euler115()</code> should return 168.
    testString: assert.strictEqual(euler115(), 168);

Challenge Seed

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

euler115();

Solution

// solution required