Find the smallest digit d (0–9) such that the four-digit number formed by 1, 2, 3 and d (i.e., 123d) is divisible by 3.
Note
A number is divisible by 3 if the sum of its digits is divisible by 3; 1+2+3=6, so adding d must keep the sum divisible by 3; the smallest such digit is 0 since 6+0 = 6.
