[Haskell-beginners] Solution to problem 17 (99 Haskell problems)‏