Pregunta de entrevista de Thread.com

One game problem with quite a lot rules to implement