HarperCollins interview question

solving problems