You are viewing a single comment's thread. Return to all comments →
int jumpingOnClouds(vector<int> c) { int jumps = 0; int i = 0; while (i < c.size() - 1) { if (i + 2 < c.size() && c[i + 2] == 0) { i += 2; } else { i += 1; } jumps++; } return jumps; }
Seems like cookies are disabled on this browser, please enable them to open this website
Jumping on the Clouds
You are viewing a single comment's thread. Return to all comments →