Function advent_solutions::advent2017::day11::solve [] [src]

pub fn solve(input: &str) -> (usize, usize)

You have the path the child process took. Starting where he started, you need to determine the fewest number of steps required to reach him. (A "step" means to move from the hex you are in to any adjacent hex.)

For example:

assert_eq!(solve("ne,ne,ne").1, 3);
assert_eq!(solve("ne,ne,sw,sw").1, 0);
assert_eq!(solve("ne,ne,s,s").1, 2);
assert_eq!(solve("se,sw,se,sw,sw").1, 3);

Part Two

How many steps away is the furthest he ever got from his starting position?