renamed row
This commit is contained in:
parent
f2d6ff15e8
commit
7ea1b80afe
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user