Files
freeCodeCamp/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-93-arithmetic-expressions.english.md
Kristofer Koishigawa 6cfd0fc503 fix: improve Project Euler descriptions, challenge seeds, and test cases (#38016)
* fix: improve Project Euler descriptions and test case

Improve formatting of Project Euler test descriptions. Also add poker hands array and new test case for problem 54

* feat: add typeof tests and gave functions proper names for first 100 challenges

* fix: continue fixing test descriptions and adding "before test" sections

* fix: address review comments

* fix: adjust grids in 18 and 67 and fix some text that reference files rather than the given arrays

* fix: implement bug fixes and improvements from review

* fix: remove console.log statements from seed and solution
2020-02-28 06:39:47 -06:00

77 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
id: 5900f3ca1000cf542c50fedc
challengeType: 5
title: 'Problem 93: Arithmetic expressions'
forumTopicId: 302210
---
## Description
<section id='description'>
By using each of the digits from the set, {1, 2, 3, 4}, exactly once, and making use of the four arithmetic operations (+, , *, /) and brackets/parentheses, it is possible to form different positive integer targets.
For example,
<div style='margin-left: 4em;'>
8 = (4 * (1 + 3)) / 2<br>
14 = 4 * (3 + 1 / 2)<br>
19 = 4 * (2 + 3) 1<br>
36 = 3 * 4 * (2 + 1)
</div>
Note that concatenations of the digits, like 12 + 34, are not allowed.
Using the set, {1, 2, 3, 4}, it is possible to obtain thirty-one different target numbers of which 36 is the maximum, and each of the numbers 1 to 28 can be obtained before encountering the first non-expressible number.
Find the set of four distinct digits, <var>a</var> < <var>b</var> < <var>c</var> < <var>d</var>, for which the longest set of consecutive positive integers, 1 to <var>n</var>, can be obtained, giving your answer as a string: <var>abcd</var>.
</section>
## Instructions
<section id='instructions'>
</section>
## Tests
<section id='tests'>
```yml
tests:
- text: <code>arithmeticExpressions()</code> should return a number.
testString: assert(typeof arithmeticExpressions() === 'number');
- text: <code>arithmeticExpressions()</code> should return 1258.
testString: assert.strictEqual(arithmeticExpressions(), 1258);
```
</section>
## Challenge Seed
<section id='challengeSeed'>
<div id='js-seed'>
```js
function arithmeticExpressions() {
// Good luck!
return true;
}
arithmeticExpressions();
```
</div>
</section>
## Solution
<section id='solution'>
```js
// solution required
```
</section>