Add solutions for problems 2, 3, 4

3rd is borrowed from Haskell Wiki