Working per se
Added dynamic programming - P1 and P2 stores