Added the solution to #0, for completeness.