Solution to problems posted on Facebook Hacker Cup 2013