Added solution for fifth problem