Optimizing a recursive algorithm by memoization · HackerTrans