freeCodeCamp/curriculum/challenges/chinese/10-coding-interview-prep/project-euler/problem-90-cube-digit-pairs.md

38 lines
1.3 KiB
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: 5900f3c61000cf542c50fed9
title: 问题90立方体数字对
challengeType: 5
videoUrl: ''
---
# --description--
立方体上的六个面中的每一个都有一个写在其上的不同数字0到9;第二个立方体也是如此。通过将两个立方体并排放置在不同的位置我们可以形成各种2位数字。
例如可以形成平方数64
实际上通过仔细选择两个立方体上的数字可以显示低于100的所有正方形数字01,04,09,16,25,36,49,64和81。
例如,可以实现的一种方法是将{0,5,6,7,8,9}放在一个立方体上,将{1,2,3,4,8,9}放在另一个立方体上。
但是对于这个问题我们应该允许将6或9颠倒以便安排像{0,5,6,7,8,9}和{1,2,3,4,6,7}允许显示所有九个方形数字;否则就不可能获得09。
在确定不同的排列时,我们对每个立方体上的数字感兴趣,而不是订单。
{1,2,3,4,5,6}相当于{3,6,4,1,2,5} {1,2,3,4,5,6}不同于{1,2 3,4,5,9}
但是因为我们允许反转6和9所以最后一个例子中的两个不同的集合都代表扩展集{1,2,3,4,5,6,9}以形成2位数字。
两个立方体有多少不同的排列可以显示所有的方形数字?
# --hints--
`euler90()`应该返回1217。
```js
assert.strictEqual(euler90(), 1217);
```
# --solutions--