Dynamic Programming Pattern Leetcode Contest Answers Pet Food