the algorithmic complexity of the twelve days of christmas