Skip to content

Latest commit

 

History

History

DP_striver

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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)