[competitive] Add enumerating utility for partial permutation.