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 {
|
pub fn process_part_1(input: &str) -> usize {
|
||||||
find_unique_window_start(input, 4)
|
find_unique_window_start(input, 4)
|
||||||
@@ -14,7 +14,7 @@ pub fn find_unique_window_start(input: &str, window_size: usize) -> usize {
|
|||||||
.chars()
|
.chars()
|
||||||
.collect::<Vec<_>>()
|
.collect::<Vec<_>>()
|
||||||
.windows(window_size)
|
.windows(window_size)
|
||||||
.take_while(|x| x.iter().unique().count() != x.len())
|
.take_while(|x| x.iter().collect::<BTreeSet<_>>().len() != x.len())
|
||||||
.count()
|
.count()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user