Department numbers: Difference between revisions
Content deleted Content added
Not a robot (talk | contribs) Add CLU |
ReeceGoding (talk | contribs) m →{{header|R}}: Syntax highlighting. |
||
Line 3,398:
=={{header|R}}==
We solve this task in two lines. The rest of the code is to make the result look nice.
<lang
solution <- allPermutations[which(rowSums(allPermutations)==12 & apply(allPermutations, 1, function(x) !any(duplicated(x)))),]
solution <- solution[order(solution$Police, solution$Sanitation),]
|