Function expedition

Source
fn expedition(input: &Input, start: usize, forward: bool) -> usize