Files
freeCodeCamp/curriculum/challenges/english/10-coding-interview-prep/project-euler/problem-166-criss-cross.english.md
mrugesh 22afc2a0ca feat(learn): python certification projects (#38216)
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
Co-authored-by: Kristofer Koishigawa <scissorsneedfoodtoo@gmail.com>
Co-authored-by: Beau Carnes <beaucarnes@gmail.com>
2020-05-27 13:19:08 +05:30

1.0 KiB

id, challengeType, isHidden, title, forumTopicId
id challengeType isHidden title forumTopicId
5900f4131000cf542c50ff25 5 false Problem 166: Criss Cross 301800

Description

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

It can be seen that in the grid

6 3 3 0 5 0 4 3 0 7 1 4 1 2 4 5

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?

Instructions

Tests

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

Challenge Seed

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

euler166();

Solution

// solution required