A solution to the Guidewire competition practice 1 problem.