Skip to content

Commit c735311

Browse files
committed
new impl
1 parent 20b763d commit c735311

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

rounds/1_histogram/solution.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ def compute_histogram(path: str) -> dict[bytes, int]:
1717
for i in range(len(data) - 1):
1818
bytes_mat[data[i]][data[i + 1]] += 1
1919

20-
counts = {bytes([i, j]): bytes_mat[i][j] for i in range(256) for j in range(256)}
20+
counts = {bytes([i, j]): c for i in range(256) for j in range(256) if (c := bytes_mat[i][j])}
2121

2222
return counts

0 commit comments

Comments
 (0)