Settings

Theme

How can I pair socks from a pile efficiently?

stackoverflow.com

2 points by ktr 5 years ago · 1 comment

Reader

simonblack 5 years ago

Buy a dozen pairs all the same. Any two socks will match.

Otherwise, you have to sort them. I usually use the random sort method.

I take a sock from the pile. Does it match any sock previously taken? If so pair them and remove from the play. If not place that sock on its own in the 'previously taken' array. Repeat till all socks taken from the pile. Any socks taken but unmatched can be kept till next time or perhaps thrown in the rubbish bin.

This method is easier to do in practice than on a computer.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection