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.