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

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -