Update How To Count Things.ipynb

This commit is contained in:
Peter Norvig
2025-12-08 12:53:52 -08:00
committed by GitHub
parent b3bef60833
commit b103599c44

View File

@@ -81,7 +81,7 @@
"\n",
"![barcode](https://upload.wikimedia.org/wikipedia/commons/thumb/a/a2/EAN-13-5901234123457.svg/250px-EAN-13-5901234123457.svg.png)\n",
"\n",
"We'll represent a unit as a character, `'B'` or `'W'`, and a barcode as a string of *n* units. The barcode above would start with `'BWWBW...'`. A valid string is one without 4 of the same character/unit in a row; `valid_barcode` tests for this.\n",
"We'll represent a unit as a character, `'B'` or `'W'`, and a barcode as a string of *n* units. The barcode above would start with `'BWBWW...'`. A valid string is one without 4 of the same character/unit in a row; `valid_barcode` tests for this.\n",
"\n",
"We'll start with the **enumerate and test** strategy: generate `all_strings` of *n* units and count how many are valid with `enumerate_barcodes`:"
]