Added solution for sixth problem