"A Teacher thinks of two consecutive numbers in the range of 1 to 10, and tells Alex one of the numbers and Sam the other.
Sam and Alex have the following conversations:
...
The possible soultion are:
(1) Alex: 2 and Sam 3
(2) Alex: 3 and Sam 4
(3) Alex: 9 and Sam 8
(4) Alex: 8 and Sam 7
If Alex does not know the answer, then his number should not be 1 or 10.
If Alex number is 3, then Sam number should be 2 or 4. But because Alex tell Sam first and Sam still does not know Alex's numbe. Based on the above logic, Sam's number should not be 2. i.e. Sam's number should be 4.
So, the 2nd possible answer is 3 and 4. Similarly, it can work from 10 backwards
So the other 2 possible soultion should be: Alex9 - Sam8 and Alex8-Sam7.