n numbers from 1 to n: each value names its own slot, so swap each one home. Every swap puts a value in place for good, at most n − 1 swaps, and then one scan finds what is missing and what is repeated. O(n), against n(n − 1)/2 comparisons for selection sort.
This interactive visualization needs JavaScript.