mirror of
https://github.com/bertptrs/adventofcode.git
synced 2025-12-25 21:00:31 +01:00
Implement 2022 day 15 part 1
This commit is contained in:
@@ -180,6 +180,12 @@ impl IndexSet {
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
|
||||
pub struct Vec2(pub [i32; 2]);
|
||||
|
||||
impl Vec2 {
|
||||
pub fn l1(self) -> i32 {
|
||||
self.0.into_iter().map(i32::abs).sum()
|
||||
}
|
||||
}
|
||||
|
||||
impl Add<Self> for Vec2 {
|
||||
type Output = Self;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user