ReplaceList

Get all subsequences of a list:

You can specify the maximum number of items:

If no rule matches, an empty list is returned:

Like in ReplaceAll, rules can be a nested list:

Possible matches for a sum: