Added solution to problem 21.
Added solution to problem 22.
Better description.
Added assertions for all implementations of the solution.