Nutmeg interview question

Second stage was a coding challenge