Why does Python's itertools.permutations contain duplicates? (When the original list has duplicates)

后端 未结 6 1763
耶瑟儿~
耶瑟儿~ 2020-11-29 03:42

It is universally agreed that a list of n distinct symbols has n! permutations. However, when the symbols are not distinct, the most common convention, in mathemati

6条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-29 04:18

    Revisiting this old question, the easiest thing to do now is to use more_itertools.distinct_permutations.

提交回复
热议问题