For a problem to be solved using dp, do we need both optimal substructure and overlapping subproblems to be satisfied by the problem or any one condition makes it eligible to solve using dp techniques?
If a problem P1 has optimal substructure but subproblems arent overlapping and if P2 has overlapping substructure but optimal substructure isnt satisfied, can i still solve P1 and P2 using dp?