Memoizatioin DP,AC