Answer prose round 1: one name for a place holding most of a postal code's land, the decision leaves the seeding to the code, and the test says what it checks

This commit is contained in:
2026-10-11 16:38:42 +02:00
committed by Lillem4n
parent 9360447254
commit 7f5a0cb63c
8 changed files with 21 additions and 24 deletions
+2 -2
View File
@@ -64,8 +64,8 @@ class Nearest:
def top_streets(count, share, minimum, column):
"""count maps (locality, street name) to a count. Returns, per locality, rows for the share of its names counted
most, at least minimum of them, ties broken by name; each row holds its count under column."""
"""count maps (locality, street name) to a count. Returns, per locality, rows for its most-counted names, share of
them rounded up and at least minimum, ties broken by name; each row holds its count under column."""
of = collections.defaultdict(list)
for (locality, name), n in count.items():
of[locality].append((n, name))