freeCodeCamp/curriculum/challenges/chinese/10-coding-interview-prep/project-euler/problem-67-maximum-path-sum...

56 lines
1.2 KiB
Markdown
Raw Normal View History

---
id: 5900f3b01000cf542c50fec2
challengeType: 5
videoUrl: ''
2020-10-01 15:54:21 +00:00
title: 问题67最大路径总和II
---
## Description
<section id="description">从下面三角形的顶部开始并移动到下面一行的相邻数字从上到下的最大总数为23. 37 4 2 4 6 8 5 9 3即3 + 7 + 4 + 9 = 23 。在triangle.txt右键单击和&#39;Save Link / Target As ...&#39;中找到从上到下的最大总数这是一个包含一百行三角形的15K文本文件。注意这是问题18的一个更难的版本。不可能尝试每条路线来解决这个问题因为共有299个如果你每秒可以检查一万亿1012条路线则需要花费超过二百亿年才能检查它们。有一种有效的算法可以解决它。 ; O </section>
## Instructions
<section id="instructions">
</section>
## Tests
<section id='tests'>
```yml
tests:
- text: <code>euler67()</code>应该返回7273。
testString: assert.strictEqual(euler67(), 7273);
```
</section>
## Challenge Seed
<section id='challengeSeed'>
<div id='js-seed'>
```js
function euler67() {
// Good luck!
return true;
}
euler67();
```
</div>
</section>
## Solution
<section id='solution'>
```js
// solution required
```
/section>