Wrote custom check which is way faster

This commit is contained in:
Dreaded_X 2022-12-06 21:31:31 +01:00
parent 8e3012b56c
commit 714c699f9b
Signed by: Dreaded_X
GPG Key ID: 76BDEC4E165D8AD9
2 changed files with 9 additions and 3 deletions

View File

@ -9,4 +9,3 @@ edition = "2021"
anyhow = "1.0"
regex = "1"
lazy_static = "1.4.0"
itertools = "0.10.5"

View File

@ -1,7 +1,6 @@
#![feature(test)]
use anyhow::Result;
use aoc::Solver;
use itertools::Itertools;
// -- Runners --
fn main() -> Result<()> {
@ -70,7 +69,15 @@ mod tests {
// -- Helpers --
fn is_start_marker(window: &[char]) -> bool {
window.len() == window.iter().unique().count()
for i in 0..window.len() {
for j in i+1..window.len() {
if window[i] == window[j] {
return false;
}
}
}
return true;
}
fn solution(input: &str, length: usize) -> usize {