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/retgbr5jSsg
int jumpingOnClouds(vector<int> c, int k) { int position = 0, energie = 100; do{ position = (position + k) % c.size(); energie -= 1 + c[position] * 2; }while(position != 0); return energie; }
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 →
Here is my c++ solution, you can watch the explanation here : https://youtu.be/retgbr5jSsg