day 6 part 2
This commit is contained in:
parent
228c5fb6d5
commit
b2bd814c8a
1 changed files with 2 additions and 2 deletions
|
@ -17,13 +17,13 @@ fn parse_input() -> Result<(Vec<i64>, Vec<i64>)> {
|
||||||
for line in stdin().lines().map_while(Result::ok) {
|
for line in stdin().lines().map_while(Result::ok) {
|
||||||
if line.starts_with("Time:") {
|
if line.starts_with("Time:") {
|
||||||
times = numbers
|
times = numbers
|
||||||
.captures_iter(&line)
|
.captures_iter(&line.replace(' ', ""))
|
||||||
.map(|c| c.get(1).unwrap().as_str().parse())
|
.map(|c| c.get(1).unwrap().as_str().parse())
|
||||||
.map_while(Result::ok)
|
.map_while(Result::ok)
|
||||||
.collect();
|
.collect();
|
||||||
} else if line.starts_with("Distance:") {
|
} else if line.starts_with("Distance:") {
|
||||||
distances = numbers
|
distances = numbers
|
||||||
.captures_iter(&line)
|
.captures_iter(&line.replace(' ', ""))
|
||||||
.map(|c| c.get(1).unwrap().as_str().parse())
|
.map(|c| c.get(1).unwrap().as_str().parse())
|
||||||
.map_while(Result::ok)
|
.map_while(Result::ok)
|
||||||
.collect();
|
.collect();
|
||||||
|
|
Loading…
Reference in a new issue