renamed row

This commit is contained in:
max.nuding 2022-12-12 14:20:10 +01:00
parent f2d6ff15e8
commit 7ea1b80afe
Failed to extract signature

View File

@ -14,20 +14,20 @@ pub fn run() {
let mut target: Coord = Default::default();
let map = lines
.enumerate()
.map(|(r, l)| {
.map(|(row, l)| {
l.chars()
.enumerate()
.map(|(col, c)| match c {
'S' => {
start = Coord {
row: r,
row,
col,
};
0
}
'E' => {
target = Coord {
row: r,
row,
col,
};
25
@ -45,7 +45,7 @@ pub fn run() {
#[cfg(feature = "part2")]
{
let starting_points = map
let min = map
.iter()
.enumerate()
.flat_map(|(row, v)| {
@ -58,9 +58,6 @@ pub fn run() {
})
.collect_vec()
})
.collect_vec();
let min = starting_points
.iter()
.filter_map(|start| bfs(&map, start.clone(), target.clone()))
.min()
.unwrap();