chore(i18n,curriculum): update translations (#43500)
This commit is contained in:
@ -8,27 +8,27 @@ dashedName: 100-doors
|
||||
|
||||
# --description--
|
||||
|
||||
连续 100 个门都是最初关闭的。 You make 100 passes by the doors. The first time through, visit every door and 'toggle' the door (if the door is closed, open it; if it is open, close it). The second time, only visit every 2nd door (i.e., door #2, #4, #6, ...) and toggle it. The third time, visit every 3rd door (i.e., door #3, #6, #9, ...), etc., until you only visit the 100th door.
|
||||
连续 100 个门都是最初关闭的。 你在门前通行了 100 次。 第一次通行时,访问每扇门,并“切换”门(如果门是关闭的,就打开它;如果门是打开的,就关闭它)。 第二次,只访问每个第二扇门(即门 #2,#4,#6,...)并切换它们。 第三次,每三个门访问一次(即门 #3,#6,#9,...)等,直到你只访问第 100 个门。
|
||||
|
||||
# --instructions--
|
||||
|
||||
Implement a function to determine the state of the doors after the last pass. Return the final result in an array, with only the door number included in the array if it is open.
|
||||
实现一个函数,以确定最后一次通过后门的状态。 以数组形式返回最终结果,数组中只包含打开的门的门号。
|
||||
|
||||
# --hints--
|
||||
|
||||
`getFinalOpenedDoors` should be a function.
|
||||
`getFinalOpenedDoors` 应该是一个函数。
|
||||
|
||||
```js
|
||||
assert(typeof getFinalOpenedDoors === 'function');
|
||||
```
|
||||
|
||||
`getFinalOpenedDoors` should return an array.
|
||||
`getFinalOpenedDoors` 应该返回一个数组。
|
||||
|
||||
```js
|
||||
assert(Array.isArray(getFinalOpenedDoors(100)));
|
||||
```
|
||||
|
||||
`getFinalOpenedDoors` should produce the correct result.
|
||||
`getFinalOpenedDoors` 应该产生正确的结果。
|
||||
|
||||
```js
|
||||
assert.deepEqual(getFinalOpenedDoors(100), solution);
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 5951e88f64ebf159166a1176
|
||||
title: 24 game
|
||||
title: 24 点游戏
|
||||
challengeType: 5
|
||||
forumTopicId: 302218
|
||||
dashedName: 24-game
|
||||
@ -8,23 +8,23 @@ dashedName: 24-game
|
||||
|
||||
# --description--
|
||||
|
||||
The [24 Game](https://en.wikipedia.org/wiki/24_Game) tests a person's mental arithmetic.
|
||||
[24 点游戏](https://en.wikipedia.org/wiki/24_Game)测试一个人的心算能力。
|
||||
|
||||
The aim of the game is to arrange four numbers in a way that when evaluated, the result is 24
|
||||
游戏的目标是使四个数字的计算结果是 24。
|
||||
|
||||
# --instructions--
|
||||
|
||||
Implement a function that takes a string of four digits as its argument, with each digit from 1 to 9 (inclusive) with repetitions allowed, and returns an arithmetic expression that evaluates to the number 24. If no such solution exists, return "no solution exists".
|
||||
实现一个函数,该函数将一个四位数的字符串作为其参数,每个数字从 1 到 9(含)并允许重复,并返回一个计算结果为数字 24 的算术表达式。 如果不存在这样的解,则返回“没有解决方案”。
|
||||
|
||||
**Rules:**
|
||||
**规则:**
|
||||
<ul>
|
||||
<li> Only the following operators/functions are allowed: multiplication, division, addition, subtraction. </li>
|
||||
<li> Division should use floating point or rational arithmetic, etc, to preserve remainders. </li>
|
||||
<li> Forming multiple digit numbers from the supplied digits is disallowed. (So an answer of 12+12 when given 1, 2, 2, and 1 is wrong). </li>
|
||||
<li> The order of the digits when given does not have to be preserved. </li>
|
||||
<li> 只允许以下运算符/函数:乘法、除法、加法、减法。 </li>
|
||||
<li> 除法应使用浮点或有理算术等来保留余数。 </li>
|
||||
<li> 不允许从提供的数字中形成多位数字。 (所以当给出 1、2、2 和 1 时,12 + 12 的答案是错误的)。 </li>
|
||||
<li> 不必依照给定的数字顺序。 </li>
|
||||
</ul>
|
||||
|
||||
| Example input | Example output |
|
||||
| 示例输入 | 示例输出 |
|
||||
| ------------------------- | ------------------------- |
|
||||
| <code>solve24("4878");</code> | <code>(7-8/8)\*4</code> |
|
||||
| <code>solve24("1234");</code> | <code>3\*1\*4\*2</code> |
|
||||
@ -33,31 +33,31 @@ Implement a function that takes a string of four digits as its argument, with ea
|
||||
|
||||
# --hints--
|
||||
|
||||
`solve24` should be a function.
|
||||
`solve24` 应该是一个函数。
|
||||
|
||||
```js
|
||||
assert(typeof solve24 === 'function');
|
||||
```
|
||||
|
||||
`solve24("4878")` should return `(7-8/8)*4` or `4*(7-8/8)`
|
||||
`solve24("4878")` 应该返回 `(7-8/8)*4` 或 `4*(7-8/8)`。
|
||||
|
||||
```js
|
||||
assert(include(answers[0], removeParentheses(solve24(testCases[0]))));
|
||||
```
|
||||
|
||||
`solve24("1234")` should return any arrangement of `1*2*3*4`
|
||||
`solve24("1234")` 应该返回 `1*2*3*4`。
|
||||
|
||||
```js
|
||||
assert(include(answers[1], removeParentheses(solve24(testCases[1]))));
|
||||
```
|
||||
|
||||
`solve24("6789")` should return `(6*8)/(9-7)` or `(8*6)/(9-7)`
|
||||
`solve24("6789")` 应该返回 `(6*8)/(9-7)` 或 `(8*6)/(9-7)`。
|
||||
|
||||
```js
|
||||
assert(include(answers[2], removeParentheses(solve24(testCases[2]))));
|
||||
```
|
||||
|
||||
`solve24("1127")` should return a permutation of `(1+7)*(1+2)`
|
||||
`solve24("1127")` 应该返回 `(1+7)*(1+2)`。
|
||||
|
||||
```js
|
||||
assert(include(answers[3], removeParentheses(solve24(testCases[3]))));
|
||||
|
Reference in New Issue
Block a user