# [Nibbles], 9 bytes (10 nibbles) ?`<+.+.,,$`_$@``p$ [Nibbles]: http://golfscript.com/nibbles/index.html ``` ?`<+.+.,,$`_$@``p$ . # map over , # 1.. ,$ # length of arg1 `_$ # getting subsequences of this length @ # from arg1 + # and flatten this list-of-list-of-lists, . # now map over this ``p$ # getting all permutations of each list, + # and flatten this list-of-list-of-lists, `< # now sort the list-of-lists, ? # and get the index of arg2. ``` [![enter image description here][1]][1] [1]: https://i.sstatic.net/1kclv.png