Dynamic Programming Time Complexity