Ubisoft Interview Question

One puzzle asked to solved