Accretive Technology interview question

Code Challenge