Hash Code is a team-based programming competition organized by Google for students and industry professionals across Europe, the Middle East and Africa. You pick your team and programming language, we pick a real-life engineering problem for you to solve. Are you up for the challenge?
This was a submission to the Google Hashcode 2015 contest (qualification round). See here for a description of the problem.