From e21663fec5a9691a119f5ab7461d1509dd02ce3f Mon Sep 17 00:00:00 2001 From: vburlacu2 Date: Wed, 13 May 2026 09:45:10 -0700 Subject: [PATCH 1/2] Add sshbur to the README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 44e0723..27b7c82 100644 --- a/README.md +++ b/README.md @@ -91,3 +91,4 @@ scripts/ ``` Each round's `data/` directory is generated locally and gitignored. +This is sshbur's PR From 5825cf3b522e148e25470486772a42fc35fd9e09 Mon Sep 17 00:00:00 2001 From: vburlacu2 Date: Wed, 13 May 2026 10:08:38 -0700 Subject: [PATCH 2/2] r1: use coutner --- rounds/1_histogram/solution.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/rounds/1_histogram/solution.py b/rounds/1_histogram/solution.py index dffbee5..836dcf2 100644 --- a/rounds/1_histogram/solution.py +++ b/rounds/1_histogram/solution.py @@ -6,9 +6,13 @@ """ +from collections import Counter + + 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 = Counter(data[i : i + 2] for i in range(len(data) - 1)) + return counts