You are viewing a single comment's thread. Return to all comments →
int jumpingOnClouds(vector<int> c, int k) { int e = 100; int cloud = 0; while (e>0) { cloud += k; e--; if(cloud>=c.size()){ cloud-=c.size(); } if(c[cloud]==1){ e-=2; } if(cloud==0){ return e; } } 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 →