Tricky but not impossible.
It seems quite hard for me. I must be missing something, since my solution fails the last validator, while passing the provided test cases and anything I could come up with.
The problem seems insufficiently explained. What happens during a round? Each player gives a pair of digits? Does that mean the number of rounds necessary is the maximum number of rounds to bruteforce the problem (because a player can give the right one first with some luck)?
Also, how can it be IMPOSSIBLE to guess a pair of digits?
Given that we know that a and b are between 1 and 9 included, the number of combinations is small (less than 81).
For instance in test case 8, the sum of digits is 11 and the product 24.
Possible combinations to get a sum of 11: (6,5) (7,4) (8,3) (9,2) => 4 turns
Possible combinations to get a product of 24: (3,8) (4,6) => 2 turns
But the expected result is IMPOSSIBLE, why ?
Is that a mistake and IMPOSSIBLE means that Maggie gave the wrong numbers on the paper and test case 8 is wrong?
Thank you in advance !
It’s a logical problem.
First, she asks Burt if he knows the digits from the set of equations. If there are too many possibilities, he can’t know the right answer, so he has to pass. Then, it’s Sarah’s turn to guess with her own informations.
The trick in this problem is that “passing” constitutes an important information for the other player.
IMPOSSIBLE means that they can guess the pair without taking the risk to fail after the rounds above.