solutions to Facebook Hacker Cup