Added solution to prefix prblem