We call a number peachy if every digit in the number is either a 3 or next to a 3. For example, the numbers 353, 93, 303, and 3373 are all peachy, but the numbers 56435, 756, 347, and 3989 are not peachy. How many positive 3-digit numbers are peachy?
Here is my solution:
There are 9*1*10 for the first one
There is 10 of the second type, but because we already counted 333 in the first case, so we don't have to count it again
Without the overcounting, we get 9 new peachy numbers in the second case.
Therefore, there are 90+9 = 99 peachy three-digit numbers.