Skip to content

Commit 1b4d342

Browse files
author
Sophia McKeever
committed
Fix tests
1 parent ffd1889 commit 1b4d342

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

rounds/1_histogram/solution.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ def compute_histogram(path: str) -> dict[bytes, int]:
2121
result = {}
2222
x = y = 0
2323
while x < 256:
24-
result[bytes([x, y])] = counts[x][y]
24+
item = counts[x][y]
25+
if item != 0:
26+
result[bytes([x, y])] = counts[x][y]
27+
2528
if y == 255:
2629
x += 1
2730
y = (y + 1) % 256

0 commit comments

Comments
 (0)