Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
5
Task/Department-numbers/R/department-numbers.r
Normal file
5
Task/Department-numbers/R/department-numbers.r
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
allPermutations <- setNames(expand.grid(seq(2, 7, by = 2), 1:7, 1:7), c("Police", "Sanitation", "Fire"))
|
||||
solution <- allPermutations[which(rowSums(allPermutations)==12 & apply(allPermutations, 1, function(x) !any(duplicated(x)))),]
|
||||
solution <- solution[order(solution$Police, solution$Sanitation),]
|
||||
row.names(solution) <- paste0("Solution #", seq_len(nrow(solution)), ":")
|
||||
print(solution)
|
||||
Loading…
Add table
Add a link
Reference in a new issue