Solutions to Google CodeJam challenges