You are viewing a single comment's thread. Return to all comments →
C++
int jumpingOnClouds(vector<int> c) { int count = 0; int n = c.size(); int i = 0; while (i < n-1) { if (i+2 < n && c[i+2] == 0) { i += 2; } else { i += 1; } ++count; } return count; }
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 →
C++