Added solution for problem number 3.