You are viewing a single comment's thread. Return to all comments →
public static int jumpingOnClouds(List<Integer> c) { int count = 0; for (int i = c.size() - 1; i > 0; i--) { int p = i - 2; int q = i - 1; if (p > -1 && c.get(p) != 1) { i = q; } count++; } return count; }
Seems like cookies are disabled on this browser, please enable them to open this website
I agree to HackerRank's Terms of Service and Privacy Policy.
Jumping on the Clouds
You are viewing a single comment's thread. Return to all comments →