Answer prose round 1: pick key leaves its root rule to pickKey, the worked example lists l's addressed keys, refuseTwiceDrawnIn recurses on an addressed key, the street rule and NANPA's sit where their readers look, and street_delivery cites only what its source states

This commit is contained in:
2026-10-07 01:59:09 +02:00
committed by Lillem4n
parent 5e9b60a88f
commit 9f96eb5a02
4 changed files with 27 additions and 27 deletions
+3 -3
View File
@@ -136,9 +136,9 @@ class Nearest:
def street_delivery(name, codes):
"""The codes delivered to a street. Outside ONE_POSITION's cities, the digit after the postort's own prefix is 0 or 1
for boxes and 8 for reply mail, that prefix being three digits where one three-digit prefix starts at least half
the postort's codes, else two; inside them, a second digit 0 marks boxes.
Per docs/research/research-geo-se.md, Postal codes → Structure."""
for boxes and 8 for reply mail; inside them, a second digit 0 marks boxes.
Per docs/research/research-geo-se.md, Postal codes → Structure.
The postort's own prefix is three digits where one three-digit prefix starts at least half its codes, else two."""
if name in ONE_POSITION:
return [c for c in codes if c[1] != "0"]
largest = collections.Counter(c[:3] for c in codes).most_common(1)[0][1]