Loro DP lan greedy butuh optimal substructure. Prabedane: greedy uga merlu greedy-choice property (local optimum iku global optimum), dene DP perlu nalika sampeyan kudu nimbang pirang-pirang pilihan lan overlapping subproblems.
Apa pentinge
Optimal substructure? -- both need this
+ greedy-choice property holds? -> GREEDY (fast, one pass of choices)
+ must compare many sub-solutions / they overlap? -> DYNAMIC PROGRAMMING
