dp(target)
that returns the largest number as a string for a given target.target
is zero, return an empty string.target
is less than zero, return '0' to indicate failure.target
is already computed, return it from the memoization table.dp(new_target)
.
c. If the result is not '0', prepend the current digit to the result and update the answer if it's larger.