Dynamic Programming, Recursion, Competitive Programming, Leetcode, 3sum.
could look as below. def sum(array): if array == []: return 0 return array[0] + sum(array[1:]) Even though this looks like a simple change, it’s actually a fundamentally different solution. In the iterative version, if we were to try to put it in natural language, would basically say “Start with 0,