Skip to content

Commit 3fbf155

Browse files
committed
Fix solution 1
1 parent a431308 commit 3fbf155

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

rounds/1_histogram/solution.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,9 @@ def compute_histogram(path: str) -> dict[bytes, int]:
1414
counts = [[0] * 256 for _ in range(256)]
1515
for i in range(len(data) - 1):
1616
counts[data[i]][data[i + 1]] += 1
17-
return {bytes((i, j)): counts[i][j] for i in range(256) for j in range(256)}
17+
return {
18+
bytes((i, j)): count
19+
for i in range(256)
20+
for j in range(256)
21+
if (count := counts[i][j])
22+
}

0 commit comments

Comments
 (0)