python - Combinations with replacements -


I know how a combination of a set is generated and it's one in Python (which I use) Built, anyway. How to generate a combination with the replacement?

Suppose I have a set, say, two equal elements - for example, AABCDE .

Combination 3 However, in the program ABC will be counted twice - Once the first A is to be used, and the second A is used The second one to do

What is a good way to generate such combinations without duplicating?

Thank you.

Change it to set , the easiest way to get rid of duplicates. is.


Comments

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -