You are viewing a single comment's thread. Return to all comments →
Here is my c++ solution, you can watch the explanation here : https://youtu.be/GNof9B-9CN0
int jumpingOnClouds(vector<int> c) { int result = 0, index = 0; while(index < c.size() - 1){ if(c[index + 2] == 1) index++; else index+=2; result++; } return result; }
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 →
Here is my c++ solution, you can watch the explanation here : https://youtu.be/GNof9B-9CN0