update problem 14

Inscrease performance from about 65s to 4s with meoization