ZeroFox interview question

Solving a optimization code problem