why for the top cell Deepak bhaiya has added dp[i][j]=(dp[i][j]+dp[i-1][j])%MOD ; But not for above If condition In which condition is of previous column ?
Why for the top cell
@rssrivastavarohan
for the above condition we write dp[i][j] = dp[i][j-1]%MOD; because dp[i][j] is 0 at that time. But for second case we write dp[i][j] = (dp[i][j] + dp[i-1][j])%MOD; because dp[i][j] can have some value already in it if above condition was true. So we need to add in that case.
@rssrivastavarohan
Mark this doubt as resolved if you don’t have any other doubt regarding this question. thanks