Dynamic Programming Pattern Leetcode Solutions Cpp Parts