I think i`ve currect solution, but i can pass last test. Can you please take a look.
function getFinalOpenedDoors(numDoors) {
let doors = new Array(numDoors).fill(false);
let result = [];
let index = 0;
while(index < 3) {
for(let i = index; i < doors.length; i = i + 1 + index) {
doors[i] = !doors[i]
}
index++;
}
for(let i = 0; i < doors.length; i++) {
if(doors[i]) {
result.push(i)
}
}
return result;
}
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36
.
Link to the challenge: