We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
functionjumpingOnClouds(c){// Write your code hereletsteps=0;letcurrentIndex=0;while(currentIndex<c.length-1){if(currentIndex+2<c.length&&c[currentIndex+2]===0){currentIndex+=2;}else{currentIndex+=1;}steps++;}returnsteps;}
Cookie support is required to access HackerRank
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 →
javaScript