for example:
dp[i-1][j] > dp[i][j-1] ? dp[i-1][j] : dp[i][j-1]
It's so long, and hard to understand .
could we use a shorter way to do this ?
such as
dp[i-1][j] > dp[i][j-1] ? $0 : $1
for example:
dp[i-1][j] > dp[i][j-1] ? dp[i-1][j] : dp[i][j-1]
It's so long, and hard to understand .
could we use a shorter way to do this ?
such as
dp[i-1][j] > dp[i][j-1] ? $0 : $1
You mean
max(dp[i-1][j], dp[i][j-1])
?
yeah, I made a mistake.
It can't be implement.
because it's bool ? a : b
can't get dp[i-1][j]
It's helpfull. thanks