freeCodeCamp/curriculum/challenges/english/10-coding-interview-prep/project-euler/problem-94-almost-equilater...

1.1 KiB

id title challengeType forumTopicId dashedName
5900f3ca1000cf542c50fedd Problem 94: Almost equilateral triangles 5 302211 problem-94-almost-equilateral-triangles

--description--

It is easily proved that no equilateral triangle exists with integral length sides and integral area. However, the almost equilateral triangle 5-5-6 has an area of 12 square units.

We shall define an almost equilateral triangle to be a triangle for which two sides are equal and the third differs by no more than one unit.

Find the sum of the perimeters of all almost equilateral triangle with integral side lengths and area and whose perimeters do not exceed one billion (1,000,000,000).

--hints--

almostEquilateralTriangles() should return a number.

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

almostEquilateralTriangles() should return 518408346.

assert.strictEqual(almostEquilateralTriangles(), 518408346);

--seed--

--seed-contents--

function almostEquilateralTriangles() {

  return true;
}

almostEquilateralTriangles();

--solutions--

// solution required