// Estimate distances for A* search
Estimate distances for A* search
Estimate distances for A * search
fn hallway_amphipods_dists_to_targets(self) -> u64 {
        self.hallway.into_iter()
            .enumerate()
            .filter_map(|(i, o)| o.map(|a| {
                let tx = target_x(a);
                move_cost(i, tx, 0, a)
            }))
            .sum()
    }
fn hallway_amphipods_dists_to_targets ( self ) -> u64 { self . hallway . into_iter ( ) . enumerate ( ) . filter_map ( | ( i , o ) | o . map ( | a | { let tx = target_x ( a ) ; move_cost ( i , tx , 0 , a ) } ) ) . sum ( ) }
Estimate distances for A* search
Estimate distances for A * search
self