#WEEKLY 18 word order
The easy way to do this is listing out all combinations and searching through them all.
That works fine when the input has 3 letters and 15 combinations, but not so well when it has 26 letters and 1096259850353149530222034276 combinations, so I used a mathematical approach so the code can efficiently calculate the results so long as the input is less than 32 letters long. Note: the code assumes a valid input. An invalid input will most likely, but not definitely cause it to panic.
Voters
AIDENSANDBAKKEN (2)
@Coder100 I don't know, it's working when I do it and correctly coming up with 2 (it's 1 indexed). You must have mistyped the key. Also, you do have to retype the key after getting an answer.
Doesn't seem to be working properly. When entered the key
abc
and subsetac
, index comes out to be7
while the desired result is4
@TheDrone7 dang it, I thought I had all the bugs worked out.