mirror of
https://github.com/Balshgit/public.git
synced 2025-09-12 16:40:43 +03:00
blocks searcher added
This commit is contained in:
parent
6d06569996
commit
8252d0d05f
@ -93,12 +93,12 @@ class BlockSearcher:
|
|||||||
|
|
||||||
# count unique items in doubled array
|
# count unique items in doubled array
|
||||||
def blocks_count(self) -> int:
|
def blocks_count(self) -> int:
|
||||||
maximum = set()
|
elements = set()
|
||||||
for row in range(self.height):
|
for row in range(self.height):
|
||||||
for elem in self.array_copy[row]:
|
for elem in self.array_copy[row]:
|
||||||
maximum.add(elem)
|
elements.add(elem)
|
||||||
maximum.remove(0)
|
elements.remove(0)
|
||||||
return len(maximum)
|
return len(elements)
|
||||||
|
|
||||||
# print both arrays for debug
|
# print both arrays for debug
|
||||||
def print(self) -> None:
|
def print(self) -> None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user