solved problem 19 in php. not a fan.