Added solution for problem #30.