Skip to content

Latest commit

 

History

History
77 lines (59 loc) · 3.54 KB

readme.md

File metadata and controls

77 lines (59 loc) · 3.54 KB

Problems on DP

DP on Grids/2D matrices

DP on Subsequences/Subsets and target

Classic Problems

DP on strings

DP on stocks: Best time to buy and sell stocks

DP on LIS

Misc

Notes/Ptrs

How do you know it's a DP problem?

  • counting no of ways
  • minimum or maximum op in case of multiple ways
  • whenever concept of try all possible ways

Tips for developing recurrence relation

  • try to represent the problem in terms of index
  • do all possible stuffs on that index according to PS
  • if question says count all ways:
    • sum up all stuffs
  • else if question says find min
    • take min(all stuffs)