What's the bug? Tests are ok but still showing remove bugs | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What's the bug? Tests are ok but still showing remove bugs

function main() { var depth = parseInt(readLine(), 10); //your code goes here var day = 0; while(1){ depth -= 7; day += 1; if(depth<=5){ day +=1; console.log(day); break; } depth +=2; } }

27th Aug 2021, 9:29 AM
Ravi
3 Answers
0
Think ! Think you are close But why you written while(1) Put an expression
27th Aug 2021, 9:54 AM
Vtec Fan
Vtec Fan - avatar
0
Not working
27th Aug 2021, 10:02 AM
Ravi
0
var day = 0; var slipping = 0; while(slipping<depth){ day = day + 1; slipping = slipping + 7; if(slipping >= depth){ console.log(day); break; } slipping = slipping - 2; }
27th Aug 2021, 10:04 AM
Vtec Fan
Vtec Fan - avatar