みんな大好きhaskellのコード。なにをしているかわかるかな?

a1 = [x % у | x <- [1,3,5,7,8,10,12], y <- [1..31]]

a2 = [x % y | x <- [2], y <- [1..28]]

a3 = [x % y | x <- [4,6,9,11], y <- [1..30]]

365 - (length $ nub $ a1 ++ a2 ++ a3)

Reply to this note

Please Login to reply.

Discussion

What does nub do?

it removes duplicates elements from a list