promptdojo_

Dimensionality and distance traps — step 5 of 7

Manhattan distance sums the ABSOLUTE differences. This version sums the raw differences, so positive and negative gaps partly cancel and the distance is wrong. Fix line 3 to use absolute differences. It should print 10.

The break is on line 3 — but read the whole snippet first.

full-screen editor opens — close anytime to keep reading.