chore(i8n,learn): processed translations
This commit is contained in:
committed by
Mrugesh Mohapatra
parent
15047f2d90
commit
e5c44a3ae5
@ -1,30 +1,34 @@
|
||||
---
|
||||
id: 594810f028c0303b75339acb
|
||||
title: 100门
|
||||
title: 100 doors
|
||||
challengeType: 5
|
||||
videoUrl: ''
|
||||
forumTopicId: 302217
|
||||
dashedName: 100-doors
|
||||
---
|
||||
|
||||
# --description--
|
||||
|
||||
<p>连续100个门都是最初关闭的。你可以在门口进行100次通行证。第一次通过,访问每扇门并“切换”门(如果门关闭,打开它;如果它打开,关闭它)。第二次,只访问每个第二个门(即门#2,#4,#6,......)并切换它。第三次,访问每个第3门(即3号门,#6号,#9号,......)等,直到您只访问第100个门。 </p><p>实现一个功能,以确定最后一次通过后门的状态。将最终结果返回到数组中,如果数组打开,则只包含数字中包含的门号。 </p>
|
||||
There are 100 doors in a row that are all initially closed. 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.
|
||||
|
||||
# --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`是一个函数。
|
||||
`getFinalOpenedDoors` should be a function.
|
||||
|
||||
```js
|
||||
assert(typeof getFinalOpenedDoors === 'function');
|
||||
```
|
||||
|
||||
`getFinalOpenedDoors`应该返回一个数组。
|
||||
`getFinalOpenedDoors` should return an array.
|
||||
|
||||
```js
|
||||
assert(Array.isArray(getFinalOpenedDoors(100)));
|
||||
```
|
||||
|
||||
`getFinalOpenedDoors`没有产生正确的结果。
|
||||
`getFinalOpenedDoors` should produce the correct result.
|
||||
|
||||
```js
|
||||
assert.deepEqual(getFinalOpenedDoors(100), solution);
|
||||
|
Reference in New Issue
Block a user