Atos Interview Question

Solving puzzle