You are viewing a single comment's thread. Return to all comments →
Here is my C# solution The do while loop help in continueing the traversal until the initial point is reached and making the initial jump.
static int jumpingOnClouds(int[] c, int k) { int e =100; int n = c.Count(); int i =0; do{ i = (i+k)%n; e--; if(c[i]==1) e-=2; }while(i!=0); return e; }
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 →
Here is my C# solution The do while loop help in continueing the traversal until the initial point is reached and making the initial jump.