Haskell Perm Check
import Data.List (sort)
permCheck :: [Int] -> Int
permCheck a = if sort a == [1 .. length a] then 1 else 0
This validates that every value from 1 to N appears exactly once.
import Data.List (sort)
permCheck :: [Int] -> Int
permCheck a = if sort a == [1 .. length a] then 1 else 0
This validates that every value from 1 to N appears exactly once.