day 6 part 2

main
Andy Teijelo 2023-12-07 11:54:11 -05:00
parent 228c5fb6d5
commit b2bd814c8a
1 changed files with 2 additions and 2 deletions

View File

@ -17,13 +17,13 @@ fn parse_input() -> Result<(Vec<i64>, Vec<i64>)> {
for line in stdin().lines().map_while(Result::ok) {
if line.starts_with("Time:") {
times = numbers
.captures_iter(&line)
.captures_iter(&line.replace(' ', ""))
.map(|c| c.get(1).unwrap().as_str().parse())
.map_while(Result::ok)
.collect();
} else if line.starts_with("Distance:") {
distances = numbers
.captures_iter(&line)
.captures_iter(&line.replace(' ', ""))
.map(|c| c.get(1).unwrap().as_str().parse())
.map_while(Result::ok)
.collect();