You are viewing a single comment's thread. Return to all comments →
static int jumpingOnClouds(int[] c, int k) { int energy = 100; int cloudsNumber = c.Count(); int count = 0; do { energy--; count += k; if(count >= cloudsNumber) count = count - cloudsNumber; if(c[count] == 1) energy-=2; }while(count != 0); return energy; }
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 →
C# Solution