pub fn parse(input: &str) -> Input
Parse the input into a bordered grid then precompute the heuristic shared by both parts.