My solution to the beekeeping problem at https://www.affirm.com/jobs. See the comments in the source code for an explanation of how it works, or just play around with it: