Added solution for 4th problem