0

How to solve "snail in the wall" code coach?

Why my code doesn't pass all tests? My attempt : 👇👇 https://code.sololearn.com/cD5h9k1VCV22/?ref=app

2nd Dec 2020, 7:02 AM
🇮🇳Vivek🇮🇳
🇮🇳Vivek🇮🇳 - avatar
2 ответов
+ 4
console.log(Math.round(input/7-2));
2nd Dec 2020, 11:35 AM
0_O-[Mägár_Sám_Äkà_Nüllpøïntêr_Èxëcéptïön]~~
0_O-[Mägár_Sám_Äkà_Nüllpøïntêr_Èxëcéptïön]~~ - avatar
+ 1
function main() { var depth = parseInt(readLine(), 10); //tu código va aquí var d = 0; // días var c = 0; // caracol while (c < depth) { c += 7 - 2; d += 1; if (c > depth) { if (c - 2 <= depth) { console.log(d); break; } else if (c > depth) { console.log(d - 1); break; } } } }
6th Jun 2021, 6:41 PM
Kevin Alexander Alvarez Echeverri
Kevin Alexander Alvarez Echeverri - avatar