Skip to main content
1 of 2
Dominic van Essen
  • 37.2k
  • 2
  • 24
  • 61

Nibbles, 9 bytes (10 nibbles)

?`<+.+.,,$`_$@``p$ 
?`<+.+.,,$`_$@``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

Dominic van Essen
  • 37.2k
  • 2
  • 24
  • 61