Given a list of strings, sort the list as numbers without knowing what base is used. The values of the digits are also unknown (it is possible that
Since the values of digits are unknown, use Benford's Law (or First Digit's Law) to determine the relative value of the digits. For distributions that follow Benford's Law, lower valued digits appear as a leading digit more frequently than higher valued digits.
- This is code-golf
- The list of strings can come from a source of your choosing (stdin, variable, file, user, etc.)
- Strings are limited to ASCII characters.
- Characters that do not appear as a leading character have the highest values. (assume there are no zeros, and sort strictly by leading frequency.)
- Characters that appear as leading digits the same number of times as other characters are weighted equally.
Note: In the example,
'cx' can appear as the 5th, 6th and 7th elements in any order since the digits
'z' are equally weighted.