Solutions to Facebook Hacker Cup 2013 problems