pub fn crossing(grid: &Grid, wire_count: u32) -> u32 {
    let mut dist: u32 = 0;

    for key in grid.keys() {
        if grid[key] != wire_count {
            continue;
        }
        let this_dist = (key.0.abs() + key.1.abs()) as u32;
        if dist == 0 || this_dist < dist {
            dist = this_dist;
        }
    }
    dist
}
/// Returns the closest point where `wire_count` wires cross from the origin, via Manhattan distance
Returns the closest point where `wire_count` wires cross from the origin, via Manhattan distance
Returns the closest point where ` wire_count ` wires cross from the origin via Manhattan distance
pub fn crossing(grid: &Grid, wire_count: u32) -> u32 {
    let mut dist: u32 = 0;
    for key in grid.keys() {
        if grid[key] != wire_count {
            continue;
        }
        let this_dist = (key.0.abs() + key.1.abs()) as u32;
        if dist == 0 || this_dist < dist {
            dist = this_dist;
        }
    }
    dist
}
pub fn crossing ( grid : & Grid , wire_count : u32 ) -> u32 { let mut dist : u32 = 0 ; for key in grid . keys ( ) { if grid [ key ] != wire_count { continue ; } let this_dist = ( key . 0 . abs ( ) + key . 1 . abs ( ) ) as u32 ; if dist == 0 || this_dist < dist { dist = this_dist ; } } dist }
Returns the closest point where `wire_count` wires cross from the origin, via Manhattan distance
Returns the closest point where ` wire_count ` wires cross from the origin via Manhattan distance
grid
&Grid
wire_count
u32
grid
&Grid
wire_count
u32