Combinations with repetitions: Difference between revisions
m
→{{header|R}}: Syntax highlighting.
(add non recursive solution) |
ReeceGoding (talk | contribs) m (→{{header|R}}: Syntax highlighting.) |
||
Line 3,167:
=={{header|R}}==
The idiomatic solution is to just use a library.
<lang
combinations(3, 2, c("iced", "jam", "plain"), set = FALSE, repeats.allowed = TRUE)
nrow(combinations(10, 3, repeats.allowed = TRUE))</lang>
|