First version of the unique path problem. 

DP/Memorization solution. The time complexity and space complexity are all O(n).