Files
freeCodeCamp/curriculum/challenges/english/10-coding-interview-prep/project-euler/problem-189-tri-colouring-a-triangular-grid.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.3 KiB

id, challengeType, title, forumTopicId
id challengeType title forumTopicId
5900f4291000cf542c50ff3c 5 Problem 189: Tri-colouring a triangular grid 301825

Description

Consider the following configuration of 64 triangles:

We wish to colour the interior of each triangle with one of three colours: red, green or blue, so that no two neighbouring triangles have the same colour. Such a colouring shall be called valid. Here, two triangles are said to be neighbouring if they share an edge. Note: if they only share a vertex, then they are not neighbours.

For example, here is a valid colouring of the above grid:

A colouring C' which is obtained from a colouring C by rotation or reflection is considered distinct from C unless the two are identical.

How many distinct valid colourings are there for the above configuration?

Instructions

Tests

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

Challenge Seed

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

euler189();

Solution

// solution required