Added solution to problem 50

This one takes nearly one minute. Will need revisiting