Sol 1. We have to select three numbers. For the first number, there is no restriction. So the number of choices is 39. The second number must be different from the first one. So the number of choices is 38. Finally, the last number has to be different from the second one. So there are 38 possibilities. Therefore, the total number of acceptable combinations is 39 × 38 × 38 = 56316.
Sol 2. Let U be the set of all possible combinations regardless it is acceptable or not. Then |U| = 393 = 59319. Let A be the set of combinations whose first two numbers are same, and let B be the set of combinations whose last two numbers are same. Then the set of non-acceptable combinations is precisely |A∪B|. |A| = |B| = 392 . A∩B is the set of combinations whose three numbers are all same. So |A ∩ B| = 39. Therefore |A ∪ B| = |A| + |B| − |A ∩ B| = 392 + 392 − 39 = 3003.
So the number of acceptable combinations is 59319 − 3003 = 56316.