Implement 2022 day 4

This commit is contained in:
2022-12-04 11:14:23 +01:00
parent e1b3b9d179
commit 9d23e80256
5 changed files with 1103 additions and 5 deletions

View File

@@ -92,3 +92,15 @@ where
}
}
}
/// Return the minimum and maximum of two unordered variables
pub fn minmax<T>(a: T, b: T) -> (T, T)
where
T: PartialOrd,
{
if a < b {
(a, b)
} else {
(b, a)
}
}