This function only computes the path cost, not the actual path. We discuss the actual path below. This, like the Fibonacci-numbers example, is horribly slow because it too exhibits the overlapping sub-problems attribute. That is, it recomputes the same path costs over and over. However, we can compute it much faster in a bottom-up fashion if we store path costs in a two-dimensional array codice_38 rather than using a function. This avoids recomputation; all the values needed for array codice_38 are computed ahead of time only once. Precomputed values for codice_15 are simply looked up whenever needed.