Two blocks, one number
transcript
A parcel wall has square blocks. No label may repeat inside a block. Each cell needs a block number. One formula looks right and is wrong.
Add the row part and the column part. Two blocks both get the number one. Multiply the row part by s, the blocks per row. Now the blocks get the numbers zero to three.
Divide the row by the block size. Multiply that by s, the blocks per row. Add the column divided by the block size.
Blocks form a small grid of their own. To number its cells you need a stride. It works like row-major layout in memory.
Test one label in two different blocks. It is valid. Test one label twice in one block. It is not. A zero means an empty slot, so skip it.
Row part times s. Plus the column part. Test blocks in the second row. Full breakdown in the lecture.