|
|
@ -1,6 +1,6 @@ |
|
|
|
use std::collections::HashMap;
|
|
|
|
|
|
|
|
const INPUT: &str = "5,2,8,16,18,0,1";
|
|
|
|
const INPUT: &str = include_str!("../../data/day15");
|
|
|
|
|
|
|
|
struct Memory {
|
|
|
|
turn: usize,
|
|
|
@ -27,7 +27,7 @@ impl Memory { |
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let input: Vec<usize> = INPUT.split(",").map(|s| s.parse().unwrap()).collect();
|
|
|
|
let input: Vec<usize> = INPUT.trim().split(",").map(|s| s.parse().unwrap()).collect();
|
|
|
|
let mut mem = Memory::new();
|
|
|
|
for &value in &input {
|
|
|
|
mem.remember(value);
|
|
|
|