You are viewing a single comment's thread. Return to all comments →
Simpliest solution for any language
static int jumpingOnClouds(int[] c) { int count=0; int i=0; while(i<c.length-1){ if(i+2<c.length&&c[i+2]!=1){ count++; i=i+2; } else{ count++; i++; } } return count; }
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 →
Simpliest solution for any language