vikalp14's blog

By vikalp14, history, 7 weeks ago, In English

I have read the solution for this problem but still have doubts about how the solution works.

Why doesnt dp[i][j] depend upon dp[i-1][j] and dp[i][j-1]

why does dp[i][j] only depend on dp[i-1][j-1]

Solution link: https://leetcode.com/problems/count-substrings-that-differ-by-one-character/discuss/1523218/C%2B%2B-DP-(Detailed-Explanation-with-Examples)

 
 
 
 
  • Vote: I like it
  • 0
  • Vote: I do not like it

»
7 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by vikalp14 (previous revision, new revision, compare).

»
7 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by vikalp14 (previous revision, new revision, compare).