Skip to main content
deleted 33 characters in body
Source Link
Dominic van Essen
  • 37.2k
  • 2
  • 24
  • 61

Nibbles, 99 8 bytes (1016 nibbles)

?`<+.+.,,$`_$@``p$`_0$``p$ 
?`<+.+.,,$`_$@``p$ `<>>+. # map over`_0$``p$   ,  `_0$ # 1..  ,$ get #all lengthsubsequences of arg1   . `_$ # gettingand subsequencesmap ofover this length   @``p$ # getting all permutations #of fromeach arg1list, +  # and flatten this list-of-list-of-lists, . # now map over this >> ``p$  # getting all permutations of each list,  + remove the #first andelement flatten(the thisempty list-of-list-of-lists), `<  # nowand sort the list-of-lists, ?  # andfinally, get the index of arg2. 

enter image description hereenter image description here

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

Nibbles, 9 8 bytes (16 nibbles)

?`<+.`_0$``p$ 
?`<>>+.`_0$``p$ `_0$ # get all subsequences of arg1 . # and map over this ``p$ # getting all permutations of each list, + # and flatten this list-of-list-of-lists, >> # remove the first element (the empty list), `< # and sort the list-of-lists, ? # finally, get the index of arg2. 

enter image description here

Source Link
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