From b879c1cb01942f0a90279a257111b53bb7c1d154 Mon Sep 17 00:00:00 2001 From: Michael Vezie Date: Wed, 13 May 2026 10:00:15 -0700 Subject: [PATCH 1/3] Add mlv to README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 44e0723..d0de913 100644 --- a/README.md +++ b/README.md @@ -91,3 +91,4 @@ scripts/ ``` Each round's `data/` directory is generated locally and gitignored. +This is 's PR From 43529b3ffabe35d03dd447622a56c6f151d132d0 Mon Sep 17 00:00:00 2001 From: Michael Vezie Date: Wed, 13 May 2026 10:08:03 -0700 Subject: [PATCH 2/3] i hate nano --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d0de913..1d3c3e4 100644 --- a/README.md +++ b/README.md @@ -91,4 +91,4 @@ scripts/ ``` Each round's `data/` directory is generated locally and gitignored. -This is 's PR +This is mlv's PR From 62401b4312846e7bf30d9160084cd269396ddd05 Mon Sep 17 00:00:00 2001 From: Michael Vezie Date: Wed, 13 May 2026 11:58:05 -0700 Subject: [PATCH 3/3] round 1 solution --- rounds/1_histogram/solution.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/rounds/1_histogram/solution.py b/rounds/1_histogram/solution.py index dffbee5..71b99e6 100644 --- a/rounds/1_histogram/solution.py +++ b/rounds/1_histogram/solution.py @@ -9,6 +9,21 @@ def compute_histogram(path: str) -> dict[bytes, int]: """Frequency of every 2-byte bigram in the file at ``path``.""" # TODO: remove this delegation and write your own implementation here. - from .baseline import compute_histogram as _baseline + with open(path, "rb") as f: + data = f.read() - return _baseline(path) + counts = [] + for ii in range(256): + counts.append([]) + for jj in range(256): + counts[ii].append(0) + + for ii in range(len(data) - 1): + counts[data[ii]][data[ii+1]] += 1 + + d = {} + for rr in range(256): + for cc in range(256): + if counts[rr][cc] > 0: + d[bytes((rr,cc))] = counts[rr][cc] + return d