Solve hanging lantern problem: Difference between revisions
Content added Content deleted
(→{{header|Raku}}: Add implementation.) |
(→{{header|Julia}}: Correct treatment of duplicate column sizes; see talk page.) |
||
Line 47:
=={{header|Julia}}==
<lang ruby>""" rosettacode.org /wiki/Lantern_Problem """
Line 55 ⟶ 54:
inputs = [parse(Int, i) for i in split(readline(), r"\s+")]
n = popfirst!(inputs)
takedownways = unique(permutations(reduce(vcat, [fill(
println("\nThere are ", length(takedownways), " ways to take these ", n, " columns down:")
for way in takedownways
|