Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

jumping on the clouds hackerarnk solution in javascrit

let jumps = 0;
let currentIndex =0;
while(currentIndex<c.length-1){
if(c[currentIndex+2]==0){
jumps += 1
currentIndex+=2;
}
else if(c[currentIndex+1]==0){
    jumps+=1
    currentIndex+=1;
}
}
return jumps
 
PREVIOUS NEXT
Tagged: #jumping #clouds #hackerarnk #solution #javascrit
ADD COMMENT
Topic
Name
2+3 =