Sanofi Interview Question

Hardest challenge and how solved