This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::env; | |
use std::fs; | |
use rayon::prelude::*; | |
fn get_arg() -> String { | |
match env::args().nth(1) { | |
Some(f) => f, | |
None => "example".into(), | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::env; | |
use std::fs; | |
use std::collections::HashSet; | |
use std::collections::HashMap; | |
fn main() { | |
let map = split_lines(get_content(get_arg())); | |
println!("Part 1: {}", part1(&map)); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::env; | |
use std::fs; | |
use std::collections::HashMap; | |
fn get_arg() -> String { | |
match env::args().nth(1) { | |
Some(f) => f, | |
None => "example".into(), | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::env; | |
use std::fs; | |
use std::collections::HashSet; | |
fn main() { | |
let grid = split_lines(get_content(get_arg())); | |
println!("Part 1: {}", part1(&grid)); | |
println!("Part 2: {}", part2(&grid)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::env; | |
use std::fs; | |
// use std::collections::HashMap; | |
use hashbrown::HashMap; | |
fn main() { | |
let numbers = split_lines(read_input()); | |
println!("Part 1: {}", part1(&numbers)); | |
println!("Part 2: {}", part2(&numbers)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::env; | |
use std::fs; | |
use hashbrown::HashSet; | |
use hashbrown::HashMap; | |
use rayon::prelude::*; | |
fn main() { | |
let graph = make_graph(read_input()); | |
println!("Part 1: {}", part1(&graph)); | |
println!("Part 2: {}", part2(&graph)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from collections import defaultdict | |
def main(args): | |
name = 'example' | |
if args: | |
name = args[0] | |
with open(name) as inf: | |
lines = inf.readlines() |
OlderNewer