2018-10-10 22:03:03 +00:00
---
id: 5900f3be1000cf542c50fed1
2020-12-16 07:37:30 +00:00
title: 问题82: 路径总和: 三种方式
2018-10-10 22:03:03 +00:00
challengeType: 5
videoUrl: ''
---
2020-12-16 07:37:30 +00:00
# --description--
2018-10-10 22:03:03 +00:00
2020-12-16 07:37:30 +00:00
注意: 这个问题是问题81的一个更具挑战性的版本。在下面的5乘5矩阵中的最小路径总和, 从左列中的任何单元格开始并在右列中的任何单元格中完成, 并且仅向上, 向下移动, 右边用红色和粗体表示;总和等于994。
2018-10-10 22:03:03 +00:00
2020-12-16 07:37:30 +00:00
$$ \\ begin {pmatrix} 131& 673& \\ color {red} {234}& \\ color {red} {103}& \\ color {red} {18} \\ \\ color {red} {201}& \\ color {红色} {96}& \\ color {red} {342}& 965& 150 \\ 630& 803& 746& 422& 111 \\ 537& 699& 497& 121& 956 \\ 805& 732& 524& 37& 331 \\ end {pmatrix} $$
2018-10-10 22:03:03 +00:00
2020-12-16 07:37:30 +00:00
在matrix.txt( 右键单击和“Save Link / Target As ...”) 中查找最小路径总和, 这是一个包含80 x 80矩阵的31K文本文件, 从左列到右列。
2018-10-10 22:03:03 +00:00
2020-12-16 07:37:30 +00:00
# --hints--
2018-10-10 22:03:03 +00:00
2020-12-16 07:37:30 +00:00
`euler82()` 应返回260324。
2018-10-10 22:03:03 +00:00
```js
2020-12-16 07:37:30 +00:00
assert.strictEqual(euler82(), 260324);
2018-10-10 22:03:03 +00:00
```
2020-12-16 07:37:30 +00:00
# --solutions--
2020-08-13 15:24:35 +00:00