Android version solution to one of the ThoughtWorks interview problems