hacker rank 2014-12-6