drop the itertools again
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
use itertools::Itertools;
|
||||
use std::collections::BTreeSet;
|
||||
|
||||
pub fn process_part_1(input: &str) -> usize {
|
||||
find_unique_window_start(input, 4)
|
||||
@@ -14,7 +14,7 @@ pub fn find_unique_window_start(input: &str, window_size: usize) -> usize {
|
||||
.chars()
|
||||
.collect::<Vec<_>>()
|
||||
.windows(window_size)
|
||||
.take_while(|x| x.iter().unique().count() != x.len())
|
||||
.take_while(|x| x.iter().collect::<BTreeSet<_>>().len() != x.len())
|
||||
.count()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user