You are viewing a single comment's thread. Return to all comments →
My rust solution:
const SOS_LEN: usize = 3; fn marsExploration(s: &str) -> i32 { (0..s.len()) .step_by(3) .map(|i| { s[i..i + 3].bytes() .zip([b'S', b'O', b'S']) .filter(|&zip| zip.0 != zip.1) .count() as i32 }) .sum() }
Seems like cookies are disabled on this browser, please enable them to open this website
Mars Exploration
You are viewing a single comment's thread. Return to all comments →
My rust solution: