convert a number to the shortest possible character string while retaining uniqueness
- by alumb
I have a list of digits, say "123456", and I need to map it to a string, any string. The only constraint on the map functions are:
each list of digits must map to a unique character string (this means the string can be arbitrarily long)
character string can only contain 0-9, a-z, A-Z
What map function would produce the shortest strings?
Solutions in JavaScript are preferred.
note: Clearly the simplest solution is to use the original list of digits, so make sure you solution does better than that.