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

66 lines
1.4 KiB
Markdown

---
id: 5900f3ca1000cf542c50fedd
challengeType: 5
title: 'Problem 94: Almost equilateral triangles'
forumTopicId: 302211
---
## Description
<section id='description'>
It is easily proved that no equilateral triangle exists with integral length sides and integral area. However, the <dfn>almost equilateral triangle</dfn> 5-5-6 has an area of 12 square units.
We shall define an <dfn>almost equilateral triangle</dfn> 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 <dfn>almost equilateral triangle</dfn> with integral side lengths and area and whose perimeters do not exceed one billion (1,000,000,000).
</section>
## Instructions
<section id='instructions'>
</section>
## Tests
<section id='tests'>
```yml
tests:
- text: <code>almostEquilateralTriangles()</code> should return a number.
testString: assert(typeof almostEquilateralTriangles() === 'number');
- text: <code>almostEquilateralTriangles()</code> should return 518408346.
testString: assert.strictEqual(almostEquilateralTriangles(), 518408346);
```
</section>
## Challenge Seed
<section id='challengeSeed'>
<div id='js-seed'>
```js
function almostEquilateralTriangles() {
return true;
}
almostEquilateralTriangles();
```
</div>
</section>
## Solution
<section id='solution'>
```js
// solution required
```
</section>