Add day 15
This commit is contained in:
parent
d34dcb5957
commit
e0900ec2ed
@ -63,7 +63,15 @@ fn main() {
|
||||
let mut beacons = vec![];
|
||||
|
||||
for line in lines {
|
||||
beacons.push(line.split([' ', '=', ':', ',']).filter_map(|tok| tok.parse::<i32>().ok()).collect::<Vec<_>>().chunks_exact(4).map(|positions| Beacon { pos: Pos(positions[0], positions[1]), beacon: Pos(positions[2], positions[3]) }).next().unwrap());
|
||||
beacons.push(
|
||||
line.split([' ', '=', ':', ','])
|
||||
.filter_map(|tok| tok.parse::<i32>().ok())
|
||||
.collect::<Vec<_>>()
|
||||
.chunks_exact(4)
|
||||
.map(|positions| Beacon { pos: Pos(positions[0], positions[1]), beacon: Pos(positions[2], positions[3]) })
|
||||
.next()
|
||||
.unwrap()
|
||||
);
|
||||
}
|
||||
|
||||
let mut possible_positions = HashSet::new();
|
||||
|
Loading…
Reference in New Issue
Block a user