https://www.codingame.com/training/medium/guessing-digits

Send your feedback or ask for help here!

Created by @Jamproject,validated by @JBM,@crashtestdummy and @Jakque.

If you have any issues, feel free to ping them.

https://www.codingame.com/training/medium/guessing-digits

Send your feedback or ask for help here!

Created by @Jamproject,validated by @JBM,@crashtestdummy and @Jakque.

If you have any issues, feel free to ping them.

I donâ€™t get why it got so many downvotes, itâ€™s a nice puzzle.

1 Like

Continuing the discussion from [Community Puzzle] Guessing digits:

I donâ€™t understand this task!

What mean " asks Burt if he knows a and b" - Burt try random or try find one by oneâ€¦

i use to for loop but it seems to be wrong idea.

I donâ€™t understand who find this a and b

The name is slightly misleading as guessing isnâ€™t allowed. They either know the exact digits or have to say they donâ€™t know. As they both start with different information saying that they donâ€™t know tells the other person something so at some point there is only one pair of digits or itâ€™s impossible.

1 Like

Example: numbers are 2 and 5

Turn 1

Burt is given 7, there are multiple combinations that give a sum of 7 so he doesnâ€™t know which one.

Sarah is given 10, the only combination is 2*5 so she can find out.

Now, letâ€™s consider another example where Burt is given 7. If Sarah doesnâ€™t find the digits on turn 1, then Burt knows for sure that the combination is not (2, 5).

By filling a big chart with the history of what can be discovered at each turn, it kills possibilities turn after turn and some of them become findable at some point.