Skip to content

Commit a9cd9f9

Browse files
authored
Update combinations with repetitions
1 parent 8d59bb7 commit a9cd9f9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

combinations with repetitions

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ print(d)
2121
d = d.tolist()
2222
b = b.tolist()
2323
c = l + b #join both the lists
24+
25+
2426
c+d #--> this is a multiset, where since 12>8, 19-8 = 11 elements are
27+
2528
#duplicates of any of the 8 available
2629
p = list(combinations(c+d,r)) #diff 1 dozen combos of 8 doughnut varieties
2730
len(p)

0 commit comments

Comments
 (0)