Scalio interview question

asked to solve a logic problem