Please subscribe to the official Codeforces channel in Telegram via the link ×

vikalp14's blog

By vikalp14, history, 17 months 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:

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

| Write comment?