You are viewing a single comment's thread. Return to all comments →
C#
public static int jumpingOnClouds(List<int> c) { var count = 0; var i = 0; var n = c.Count; while (i < n - 1) { if (i + 2 < n && c[i + 2] == 0) { i += 2; } else { i += 1; } count++; } return count; }
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 →
C#