Assumes familiarity with data structures and sorting!
Use quicksort.
Back to the Matching Nuts and Bolts puzzle
Solution
Back to the Puzzler page