in reply to sort with fewest moves
For some reason this reminded me of the [id://Hanoi|Towers of Hanoi].
There are of course some differences
(slots<n in Hanoi, no swapping either {jlongino++}),
but they do seem to be rather similar.
--
perl -pe "s/\b;([st])/'\1/mg"
In Section
Seekers of Perl Wisdom