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);
|
||||
|
Reference in New Issue
Block a user