D4P2: Replace fold with any
This commit is contained in:
parent
df623d13cc
commit
ceff5b0eb5
|
@ -12,7 +12,7 @@ pub fn main() {
|
|||
vec.iter()
|
||||
.group_by(move |n| *n)
|
||||
.into_iter()
|
||||
.fold(false, |acc, (_, v)| acc || v.count() == 2)
|
||||
.any(|(_, v)| v.count() == 2)
|
||||
});
|
||||
println!("Part 2: {}", part2.count());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user