From 8252d0d05ff1f9862c25e87d17a9be5fb4a04193 Mon Sep 17 00:00:00 2001 From: Dmitry Afanasyev Date: Tue, 12 Oct 2021 02:46:02 +0300 Subject: [PATCH] blocks searcher added --- blocks.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/blocks.py b/blocks.py index 6293054..a2abe60 100644 --- a/blocks.py +++ b/blocks.py @@ -93,12 +93,12 @@ class BlockSearcher: # count unique items in doubled array def blocks_count(self) -> int: - maximum = set() + elements = set() for row in range(self.height): for elem in self.array_copy[row]: - maximum.add(elem) - maximum.remove(0) - return len(maximum) + elements.add(elem) + elements.remove(0) + return len(elements) # print both arrays for debug def print(self) -> None: