Back to Freecodecamp

Problem 166: Criss Cross

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

latest726 B
Original Source

--description--

A 4x4 grid is filled with digits $d$, $0 ≤ d ≤ 9$.

It can be seen that in the grid

$$\begin{array}{} 6 & 3 & 3 & 0 \\ 5 & 0 & 4 & 3 \\ 0 & 7 & 1 & 4 \\ 1 & 2 & 4 & 5 \end{array}$$

the sum of each row and each column has the value 12. Moreover the sum of each diagonal is also 12.

In how many ways can you fill a 4x4 grid with the digits $d$, $0 ≤ d ≤ 9$ so that each row, each column, and both diagonals have the same sum?

--hints--

crissCross() should return 7130034.

js
assert.strictEqual(crissCross(), 7130034);

--seed--

--seed-contents--

js
function crissCross() {

  return true;
}

crissCross();

--solutions--

js
// solution required