IBM Interview Question

what's wrong this code (on dynamic programming)