freeCodeCamp/curriculum/challenges/chinese/10-coding-interview-prep/project-euler/problem-152-writing-one-hal...

26 lines
709 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

---
id: 5900f4041000cf542c50ff17
title: 问题152将一半写为倒数平方和
challengeType: 5
videoUrl: ''
---
# --description--
有几种方法可以使用不同的整数将数字1/2写成反平方和。
例如,可以使用数字{2,3,4,5,7,12,15,20,28,35}
实际上仅使用2到45之间的整数包括2和45完全可以通过三种方式来实现其余两种方式是{2,3,4,6,7,9,10,20,28,35,36,45 }和{2,3,4,6,7,9,12,15,28,30,35,36,45}。 使用2到80之间含2和80的不同整数有多少种方法可以将数字1/2写成反平方和
# --hints--
<code>euler152()&lt;/ code>应该返回301。
```js
assert.strictEqual(euler152(), 301);
```
# --solutions--