I've just started with dfs shortes path problems and i'm really gettig confused while using memoization techniques to decrease the time complexity
Please check these two problems
and in this case
I've seen solutions where people used memoization techniques with array memo, where memo[i] is max/min value from i to end say i to n-1
so my general doubt is that when to memoize from start to i and when from i to end
im really confused now, as to use which one? Can someone please help with this.