Archive for April, 2010

Get to Work – March 2010

April 26th, 2010

Google Code Jam – Get to Work

The problem:
For anyone looking at this problem, here’s something that you should know about this problem. Although it’s not explicitly stated that I saw, the sample data implies that if an employee is in the office hometown, that person does not need to commute via a vehicle and can be excluded.

Other than that, it’s relatively simple. Create a list of employees with their hometown and commuter capacity, then just iterate through that list (sorted by commuter capacity) for each hometown. You should be able to either determine that minimum number of cars needed or that it’s impossible relatively quickly.
» Read more: Get to Work – March 2010

Odd Man Out – March 2010

April 25th, 2010

Google Code Jam – Odd Man Out

The problem:
This problem is pretty easy. Basically, we have N number of integers with one of them being unique. It’s easy enough to simply search through a list of the provided integers until you run across one that has only 1 match in the list – that’s your answer.

And yes, I know I can break the loop after I’ve found the lone integer – since this is so quick running and it’s nothing important, I didn’t bother going back to fix that.
» Read more: Odd Man Out – March 2010