summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--3.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/3.py b/3.py
index 32596ef..2eed1b7 100644
--- a/3.py
+++ b/3.py
@@ -11,7 +11,7 @@ def column(rows: Iterable[Bits], n: int) -> Generator[bool, None, None]:
def most_common(bits: Iterable[bool]) -> bool:
freqs: list[tuple[bool, int]] = Counter(bits).most_common()
- if freqs[0][1] == freqs[1][1]:
+ if len(freqs) > 1 and freqs[0][1] == freqs[1][1]:
return True
return freqs[0][0]