You are viewing a single comment's thread. Return to all comments →
JAVA solution
static int jumpingOnClouds(int[] c, int k) { int e = 100, jump = 0; while(true){ e--; if(c[jump] == 1) e -= 2; jump = (jump + k) % c.length; if (jump == 0) break; } return e; }
Jumping on the Clouds: Revisited
You are viewing a single comment's thread. Return to all comments →
JAVA solution