rm dbg
This commit is contained in:
parent
461169bfab
commit
9790369331
1 changed files with 13 additions and 14 deletions
|
@ -19,19 +19,19 @@ pub fn solve() {
|
|||
})
|
||||
.collect();
|
||||
|
||||
// let mut curr = String::from("AAA");
|
||||
// let mut i = 0;
|
||||
// while curr != String::from("ZZZ") {
|
||||
// dbg!(curr.as_str());
|
||||
// curr = match instr[i % instr.len()] {
|
||||
// 'L' => map.get(curr.as_str()).unwrap().0.clone(),
|
||||
// 'R' => map.get(curr.as_str()).unwrap().1.clone(),
|
||||
// _ => panic!()
|
||||
// };
|
||||
// i+=1;
|
||||
// }
|
||||
let mut curr = String::from("AAA");
|
||||
let mut i = 0;
|
||||
while curr != String::from("ZZZ") {
|
||||
dbg!(curr.as_str());
|
||||
curr = match instr[i % instr.len()] {
|
||||
'L' => map.get(curr.as_str()).unwrap().0.clone(),
|
||||
'R' => map.get(curr.as_str()).unwrap().1.clone(),
|
||||
_ => panic!()
|
||||
};
|
||||
i+=1;
|
||||
|
||||
|
||||
// println!("Result 1: {}", i);
|
||||
println!("Result 1: {}", i);
|
||||
|
||||
|
||||
let mut curr: Vec<String> = map.keys()
|
||||
|
@ -55,13 +55,12 @@ pub fn solve() {
|
|||
});
|
||||
i+=1;
|
||||
}
|
||||
dbg!(steps.clone());
|
||||
|
||||
let result = steps.iter()
|
||||
.fold(1, |x,y| {
|
||||
num::integer::lcm(x,*y)
|
||||
});
|
||||
|
||||
println!("Result 1: {}", result);
|
||||
println!("Result 2: {}", result);
|
||||
|
||||
}
|
Loading…
Reference in a new issue