Solve Problem 69 in Haskell