Solution to a combinatorics puzzle