You are viewing a single comment's thread. Return to all comments →
RUST:
fn jumpingOnClouds(c: &[i32]) -> i32 { let n = c.len() - 1; let mut jumps = 0; let mut position = 0; while position < n { if position + 2 <= n && c[position + 2] == 0 { position += 2; } else { position += 1; } jumps += 1; } 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 →
RUST: