my solutions to advent of code
aoc
advent-of-code
1struct Combination {
2 original: String,
3 target: String,
4}
5
6fn main() {
7 let input: String = std::fs::read_to_string("../input.txt").expect("invalid input!!");
8 let input: Vec<&str> = input.split("\n").collect();
9 let combinations: Vec<Combination> = &input[..input.len() - 2].iter().map(|v| {
10 let v: Vec<&str> = v.split(" ").collect();
11 match v[..] {
12 [original, _, target] => Combination {
13 original: original.to_string(),
14 target: target.to_string(),
15 },
16 _ => Combination {
17 original: "".to_string(),
18 target: "".to_string(),
19 },
20 }
21 }).
22}