Aristocrat Interview Question

they gave me some logical game question