In a certain code language, ‘COAL’ is coded as ‘7649’ and ‘ALSO’ is coded as ‘5967’. What is the code for ‘S’ in the given code language?
5
The word COAL uses the letters {C, O, A, L} and is coded by the digits {7, 6, 4, 9}.
The word ALSO uses the letters {A, L, S, O} and is coded by the digits {5, 9, 6, 7}.
The letters common to both words are A, L and O, so their digits must lie in both digit sets. The digits common to {7, 6, 4, 9} and {5, 9, 6, 7} are {6, 7, 9}, which therefore stand for A, L and O.
In COAL the remaining letter is C, matching the leftover digit 4; in ALSO the remaining letter is S, matching the leftover digit 5.
Hence, the code for S is 5.