You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-- 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.
The text was updated successfully, but these errors were encountered:
Test is too simple. A lot of false positives.
The text was updated successfully, but these errors were encountered: