Given a word, get the indexes of each letter in the alphabet.
For example:
uncopyrightable
becomes:[21, 14, 3, 15, 16, 25, 18, 9, 7, 8, 20, 1, 2, 12, 5]
Convert these indexes to the given numeral system.
For example, if the radix is
36
, then the array above would become:
['l', 'e', '3', 'f', 'g', 'p', 'i', '9', '7', '8', 'k', '1', '2', 'c', '5']
Joining those gives
le3fgpi978k12c5
.
Of course you don't have to use arrays.
More examples:
dermatoglyphics
,36
→45id1kf7cpg893j
undiscoverability
,8
→25164112331726522121114112431
superacknowledgement
,16
→13151051213bef17c5475d5e14
- Your input will be a word (you decide if it'll be uppercase, lowercase or mixed) and a valid radix (2-36).
- You can receive input through any of the standard IO methods.
- This is code-golf, so shortest code in bytes wins!
0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ
? What's the maximum base value? 64? \$\endgroup\$