promptdojo_

Dimensionality and distance traps — step 7 of 7

Checkpoint

One last thing before we move on. Same surface as a write step — but the lesson doesn't complete until this passes.

Checkpoint: nearest-neighbor search. Write nearest(query, candidates) that returns the name of the candidate whose vec is closest to query by Euclidean distance.

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