+ 1

Help me please!

Hi folks, I'd like you to help me finish this end of module #23 javascript project code on the well snail please. https://code.sololearn.com/WQB6wjZzsUv5/?ref=app

13th Apr 2021, 3:54 AM
KEVIN MEJIA
KEVIN MEJIA - avatar
2 Answers
+ 2
Your code: function main() { var depth = parseInt(readLine(15), 10); var metros = 0; var i = 1; while(metros<=depth){ metros += 5; if(metros>=depth){ break; } i++; } } My code: function main() { var depth = parseInt(readLine(), 10); var reach = 0; var days = 0; do{ reach += 7; if(reach < depth) reach -=2; ++days; } while(reach < depth); console.log(days); } This shud help
13th Apr 2021, 4:42 AM
Sharique Khan
Sharique Khan - avatar
13th Apr 2021, 5:34 AM
Arun Ruban SJ
Arun Ruban SJ - avatar