My solution to one of the qualifier facebook hacker cup problems. This is not the one I actually submitted, my submission was wrong. But I was able to fix it literally 5 minutes after I saw what was wrong.