Solution to the roadtrip problem.