You are viewing a single comment's thread. Return to all comments →
function jumpingOnClouds(c) { let counter = 0; // minimal jumps if (c.length === 3){ return 1 } for (let i = 0; i < c.length; i++){ if (c[i] === 0){ if (c[i + 2] === 0){ counter++ i = i +1; } else { if (c[i + 1] === 0 ){ counter++ } } } } return counter }
Seems like cookies are disabled on this browser, please enable them to open this website
Jumping on the Clouds
You are viewing a single comment's thread. Return to all comments →