Skip to content

Commit

Permalink
4th 5th 6th dec 2022
Browse files Browse the repository at this point in the history
  • Loading branch information
lismith2-cisco committed Dec 7, 2022
1 parent 1c57350 commit 3661ba7
Show file tree
Hide file tree
Showing 6 changed files with 1,578 additions and 0 deletions.
14 changes: 14 additions & 0 deletions 2022_4_cleanup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
splitlines = ([elf.split('-') for elf in line.strip().split(',')]
for line in open("2022_4_cleanup_input.txt"))
total_overlaps = 0
overlaps = 0
for elf_a, elf_b in splitlines:
set_a = set(range(int(elf_a[0]), int(elf_a[1])+1))
set_b = set(range(int(elf_b[0]), int(elf_b[1])+1))
#print(set_a, set_b)
if set_a <= set_b or set_b <= set_a:
total_overlaps += 1
if set_a & set_b:
overlaps += 1
print(total_overlaps)
print(overlaps)
Loading

0 comments on commit 3661ba7

Please sign in to comment.