You are viewing a single comment's thread. Return to all comments →
//Java public static int jumpingOnClouds(List<Integer> c) { int steps = 0; int currentIndex= 0; while(currentIndex<c.size()-1){ if(currentIndex+2<c.size() && c.get(currentIndex+2)==0){ currentIndex += 2; } else{ currentIndex += 1; } steps++; } return steps; }
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 →