Fill dp [ ] [ ] table with - 1 , indicating that results are not computed yet
for i in range ( sz ) : NEW_LINE INDENT for j in range ( sz ) : NEW_LINE INDENT dp [ i ] [ j ] = - 1 NEW_LINE DEDENT DEDENT