You are viewing a single comment's thread. Return to all comments →
static int jumpingOnClouds(int[] c, int k) { int en = 0; int i = 0; while((i+k)%c.length != 0){ en++; if(c[i%c.length] == 1){ en = en+2 ;
} i=i+k ; } if(c[c.length-k] == 1 ) en = en+2; en++; return 100-en; }
Seems like cookies are disabled on this browser, please enable them to open this website
Jumping on the Clouds: Revisited
You are viewing a single comment's thread. Return to all comments →
static int jumpingOnClouds(int[] c, int k) { int en = 0; int i = 0; while((i+k)%c.length != 0){ en++; if(c[i%c.length] == 1){ en = en+2 ;