Solution to an assignment given as part of an interview at ThoughtWorks