aakarshmadhavan's blog

By aakarshmadhavan, history, 4 weeks ago, In English,

Interesting DP problem:

The formula is supposed to be DP[i][d] = # of arithmetic subsequences slices ending at index i with difference d

Can someone explain how to come up with this and also how to come up with a recurrence relation?


  • Vote: I like it  
  • -3
  • Vote: I do not like it