We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 20b763d commit c735311Copy full SHA for c735311
1 file changed
rounds/1_histogram/solution.py
@@ -17,6 +17,6 @@ def compute_histogram(path: str) -> dict[bytes, int]:
17
for i in range(len(data) - 1):
18
bytes_mat[data[i]][data[i + 1]] += 1
19
20
- counts = {bytes([i, j]): bytes_mat[i][j] for i in range(256) for j in range(256)}
+ counts = {bytes([i, j]): c for i in range(256) for j in range(256) if (c := bytes_mat[i][j])}
21
22
return counts
0 commit comments