Added solution to problem 49.