Improve day 22 with Brent's cycle finding

This commit is contained in:
2020-12-23 18:56:21 +01:00
parent 339be73efc
commit 3cbc401841
2 changed files with 16 additions and 6 deletions

View File

@@ -73,9 +73,11 @@ impl Solution for Day23 {
mod tests {
use super::*;
const SAMPLE: &[u8] = b"389125467";
#[test]
fn sample_part1() {
let sample = [3, 8, 9, 1, 2, 5, 4, 6, 7];
let sample = read_input(&mut SAMPLE.as_ref());
assert_eq!("92658374", &play_game(&mut sample.clone(), 10));
assert_eq!("67384529", &play_game(&mut sample.clone(), 100));
}