Javascript solutions to Google Code Jam problems