In a certain code language, ‘DONE’ is coded as ‘5432’ and ‘CODE’ is coded as ‘2835’. What is the code for ‘C’ in the given code language?
8
List the letters and the digit-set used for each word (the digits are a scrambled code, not positional).
DONE uses the letters {D, O, N, E} and the digits {5, 4, 3, 2}.
CODE uses the letters {C, O, D, E} and the digits {2, 8, 3, 5}.
The letters common to both words are O, D and E. So the digits common to both sets must code these three letters.
Common digits of {5, 4, 3, 2} and {2, 8, 3, 5} are {2, 3, 5}, which therefore stand for O, D and E in some order.
In CODE the digits are {2, 8, 3, 5}; removing the shared {2, 3, 5} for O, D, E leaves 8, which must code the remaining letter C.
Hence, the code for C is 8.