Added solution for problem #12.