Ubisoft interview question

2-3 maths and logical que