Jane Street interview question

standard programming interview - create some code to solve a simple problem