mirror of
https://github.com/bertptrs/adventofcode.git
synced 2025-12-25 21:00:31 +01:00
More numpy for speed
This commit is contained in:
@@ -20,11 +20,10 @@ class DayRunner(CombinedRunner):
|
|||||||
else:
|
else:
|
||||||
keys.append(heights)
|
keys.append(heights)
|
||||||
|
|
||||||
fitting = 0
|
locks = numpy.stack(locks, axis=0)
|
||||||
|
|
||||||
for key in keys:
|
fitting = sum(
|
||||||
for lock in locks:
|
numpy.count_nonzero(numpy.all((key + locks) <= 7, axis=1)) for key in keys
|
||||||
if numpy.all((key + lock) <= 7):
|
)
|
||||||
fitting += 1
|
|
||||||
|
|
||||||
return fitting, None
|
return fitting, None
|
||||||
|
|||||||
Reference in New Issue
Block a user