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