-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
-- Function to accumulate all lists for which isDerangement == True.
-- If the list of permutations is empty, check if the sum of derangements by function
-- equals the factorial of 9 (length of the inputlists).
-- If so, isDerangement works properly for lists up to 9.
testDerangements :: Int -> [[Int]] -> Bool
testDerangements acc [] = acc == subfactorial 9
testDerangements acc (x:xs) =
if isDerangement [1..9] x
then testDerangements (acc + 1) xs
else testDerangements (acc) xs
Test is too simple. A lot of false positives.
Metadata
Metadata
Assignees
Labels
No labels