Hacker News new | ask | show | jobs
by rishabhparikh 3152 days ago
The memoization occurs in the fact that we are "remembering" the previous value (pre_sum). It's a little different in that we aren't memoizing/caching all previous values, but we are still caching the last computed values aka the "tail".