Problem #16 Haskell solved