Inteliment interview question

Assignment was given.