mirror of
https://github.com/bertptrs/adventofcode.git
synced 2025-12-26 21:30:31 +01:00
Implement 2022 day 17 part 1
This commit is contained in:
@@ -176,6 +176,15 @@ impl IndexSet {
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
pub fn contains(&self, index: usize) -> bool {
|
||||
let (entry, pos) = Self::index(index);
|
||||
|
||||
self.0
|
||||
.get(entry)
|
||||
.map(|&entry| (entry & (1 << pos) != 0))
|
||||
.unwrap_or(false)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
|
||||
|
||||
Reference in New Issue
Block a user