Files
freeCodeCamp/curriculum/challenges/english/10-coding-interview-prep/project-euler/problem-189-tri-colouring-a-triangular-grid.md
gikf 5a52c229f5 fix(curriculum): clean-up Project Euler 181-200 (#42819)
* fix: clean-up Project Euler 181-200

* fix: corrections from review

Co-authored-by: Tom <20648924+moT01@users.noreply.github.com>

* fix: missing delimiter

Co-authored-by: Tom <20648924+moT01@users.noreply.github.com>
2021-07-15 15:52:14 +02:00

1.7 KiB

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

--description--

Consider the following configuration of 64 triangles:

64 triangles arranged to create larger triangle with side length of 8 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:

colored grid of 64 triangles

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?

--hints--

triangularGridColoring() should return 10834893628237824.

assert.strictEqual(triangularGridColoring(), 10834893628237824);

--seed--

--seed-contents--

function triangularGridColoring() {

  return true;
}

triangularGridColoring();

--solutions--

// solution required