chore(i18n,learn): processed translations (#44866)
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 594810f028c0303b75339acb
|
||||
title: 100 doors
|
||||
title: 100個のドア
|
||||
challengeType: 5
|
||||
forumTopicId: 302217
|
||||
dashedName: 100-doors
|
||||
@ -8,27 +8,27 @@ dashedName: 100-doors
|
||||
|
||||
# --description--
|
||||
|
||||
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.
|
||||
100個のドアが連続してあり、最初はすべてのドアは閉じています。 100個のドア全てを対象とします。 1回目はすべてのドアを訪問し、ドアを「切り替え」(ドアが閉じられている場合は、開き、開いている場合は、閉じる)ます。 2回目は、2の倍数のドア(#2のドア、#4のドア、#6のドア...)に訪問し、それぞれの開閉を「切り替え」ます。 3回目は、3の倍数のドア(#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.
|
||||
3回の訪問が終了した時点でのドアの状態を示す関数を作成します。 配列形式で最終的な結果を返します。開いている状態のドアの番号を配列形式で返します。
|
||||
|
||||
# --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);
|
||||
|
Reference in New Issue
Block a user