Scalio Interview Question

asked to solve a logic problem