freeCodeCamp/curriculum/challenges/english/10-coding-interview-prep/project-euler/problem-85-counting-rectang...

1.1 KiB

id title challengeType forumTopicId dashedName
5900f3c11000cf542c50fed4 Problem 85: Counting rectangles 5 302199 problem-85-counting-rectangles

--description--

By counting carefully it can be seen that a rectangular grid measuring 3 by 2 contains eighteen rectangles:

a diagram of the different rectangles found within a 3 by 2 rectangular grid

Although there exists no rectangular grid that contains exactly two million rectangles, find the area of the grid with the nearest solution.

--hints--

countingRectangles() should return a number.

assert(typeof countingRectangles() === 'number');

countingRectangles() should return 2772.

assert.strictEqual(countingRectangles(), 2772);

--seed--

--seed-contents--

function countingRectangles() {

  return true;
}

countingRectangles();

--solutions--

// solution required