diff options
Diffstat (limited to '2022/04/b.rs')
| -rw-r--r-- | 2022/04/b.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/2022/04/b.rs b/2022/04/b.rs new file mode 100644 index 0000000..2affb65 --- /dev/null +++ b/2022/04/b.rs | |||
| @@ -0,0 +1,8 @@ | |||
| 1 | mod common; | ||
| 2 | use common::*; | ||
| 3 | |||
| 4 | fn main() { | ||
| 5 | let overlap = |a: (i64, i64), b: (i64, i64)| | ||
| 6 | (a.0 >= b.0 && a.0 <= b.1) || (b.0 >= a.0 && b.0 <= a.1); | ||
| 7 | println!("{}", count(overlap)); | ||
| 8 | } | ||
