Add solutions for chapter 4.
Merge branch 'ch04'