chore(i8n,learn): processed translations
This commit is contained in:
committed by
Mrugesh Mohapatra
parent
15047f2d90
commit
e5c44a3ae5
@ -1,36 +1,60 @@
|
||||
---
|
||||
id: 59f40b17e79dbf1ab720ed7a
|
||||
title: 部门编号
|
||||
title: Department Numbers
|
||||
challengeType: 5
|
||||
videoUrl: ''
|
||||
forumTopicId: 302249
|
||||
dashedName: department-numbers
|
||||
---
|
||||
|
||||
# --description--
|
||||
|
||||
<p>有一个高度组织化的城市决定为每个部门分配一个号码: </p>警察局环卫部门消防部门<p>每个部门的数字可以在1到7之间(含)。 </p><p>这三个部门编号应该是唯一的(彼此不同),并且必须加起来为12。 </p><p>警察局长不喜欢奇怪的号码,并希望他的部门有一个偶数。 </p>任务: <p>编写一个输出所有有效组合的程序: </p><p> [2,3,7] </p><p> [2,4,6] </p><p> [2,6,4] </p><p> [2,7,3] </p><p> [4,1,7] </p><p> [4,2,6] </p><p> [4,3,5] </p><p> [4,5,3] </p><p> [4,6,2] </p><p> [4,7,1] </p><p> [6,1,5] </p><p> [6,2,4] </p><p> [6,4,2] </p><p> [6,5,1] </p>
|
||||
There is a highly organized city that has decided to assign a number to each of their departments:
|
||||
|
||||
<ul>
|
||||
<li>Police department</li>
|
||||
<li>Sanitation department</li>
|
||||
<li>Fire department</li>
|
||||
</ul>
|
||||
|
||||
Each department can have a number between 1 and 7 (inclusive).
|
||||
|
||||
The three department numbers are to be unique (different from each other) and must add up to the number 12.
|
||||
|
||||
The Chief of the Police doesn't like odd numbers and wants to have an even number for his department.
|
||||
|
||||
# --instructions--
|
||||
|
||||
Write a program which outputs all valid combinations as an array.
|
||||
|
||||
```js
|
||||
[2, 3, 7] [2, 4, 6] [2, 6, 4]
|
||||
[2, 7, 3] [4, 1, 7] [4, 2, 6]
|
||||
[4, 3, 5] [4, 5, 3] [4, 6, 2]
|
||||
[4, 7, 1] [6, 1, 5] [6, 2, 4]
|
||||
[6, 4, 2] [6, 5, 1]
|
||||
```
|
||||
|
||||
# --hints--
|
||||
|
||||
`combinations`应该是一个功能。
|
||||
`combinations` should be a function.
|
||||
|
||||
```js
|
||||
assert(typeof combinations === 'function');
|
||||
```
|
||||
|
||||
`combinations([1, 2, 3], 6)`应该返回一个数组。
|
||||
`combinations([1, 2, 3], 6)` should return an Array.
|
||||
|
||||
```js
|
||||
assert(Array.isArray(combinations([1, 2, 3], 6)));
|
||||
```
|
||||
|
||||
`combinations([1, 2, 3, 4, 5, 6, 7], 12)`应返回长度为14的数组。
|
||||
`combinations([1, 2, 3, 4, 5, 6, 7], 12)` should return an array of length 14.
|
||||
|
||||
```js
|
||||
assert(combinations(nums, total).length === len);
|
||||
```
|
||||
|
||||
`combinations([1, 2, 3, 4, 5, 6, 7], 12)`应返回所有有效组合。
|
||||
`combinations([1, 2, 3, 4, 5, 6, 7], 12)` should return all valid combinations.
|
||||
|
||||
```js
|
||||
assert.deepEqual(combinations(nums, total), result);
|
||||
|
Reference in New Issue
Block a user