Solution for the problem Peek traffic puzzle proposed in www.codeeval.com