diff options
-rw-r--r-- | 3.py | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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] |