From a1e946494bd3096d47cf43cd21260a023c3c7c05 Mon Sep 17 00:00:00 2001 From: Stefan Harmuth Date: Sun, 6 Dec 2020 08:44:55 +0100 Subject: [PATCH] get rid of numpy makes it >10x faster --- day06.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/day06.py b/day06.py index 0917fc1..9d651a7 100644 --- a/day06.py +++ b/day06.py @@ -1,6 +1,4 @@ -#!/usr/bin/env python3 import aoclib -import numpy DAY = 6 TEST_SOLUTION_PART1 = 11 @@ -37,7 +35,7 @@ def part2(test_mode=False): answer_buffer = list(answer_group[0]) for answer_line in answer_group: answer_line = list(answer_line) - answer_buffer = list(numpy.intersect1d(answer_buffer, answer_line)) + answer_buffer = list(set(answer_buffer).intersection(answer_line)) yes_count = yes_count + len(answer_buffer)