0
Anytime I execute this code,it says execution timed out..can anyone help please??
function main() { var depth = parseInt(readLine(), 10); //your code goes here var day= 1; var n=5; var o=n+5; do{ console.log(day);n+5;day++; if(o>=depth){ break; } } while(o<=depth); }
4 Respostas
+ 3
o never changes so the loop keeps running infinitely
+ 1
The o variables never changes in the loop, so o > depth is never true. Therefore, you never break from the while loop
0
I did change it,day++
Or?
0
Okay I get it now, thank you.