Combinations with repetitions: Difference between revisions

→‎{{header|Ruby}}: Fluff up the size calculation example
(→‎{{header|Ruby}}: Fluff up the size calculation example)
Line 3,213:
 
# Extra credit
possible_doughnuts = [*1..101000].repeated_combination(330)
# size returns the size of the enumerator, or nil if it can’t be calculated lazily.
puts "", "#{possible_doughnuts.size} ways to order 330 donuts given 101000 types."</lang>
</lang>
{{out}}
<pre>
Line 3,226 ⟶ 3,227:
plain and plain
 
2205799990040867421088231767567302459508715964845043404147200 ways to order 330 donuts given 101000 types.
</pre>
 
=={{header|Rust}}==
<lang rust>
1,149

edits