Back to Freecodecamp

Problem 189: Tri-coloring a triangular grid

curriculum/challenges/english/blocks/project-euler-problems-101-to-200/5900f4291000cf542c50ff3c.md

latest1.5 KB
Original Source

--description--

Consider the following configuration of 64 triangles:

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

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

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

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

--hints--

triangularGridColoring() should return 10834893628237824.

js
assert.strictEqual(triangularGridColoring(), 10834893628237824);

--seed--

--seed-contents--

js
function triangularGridColoring() {

  return true;
}

triangularGridColoring();

--solutions--

js
// solution required