def memo_fibonacci(n, memo=[]):
    """
    A fibonacci function that uses memoization.
    Subproblems that we've done are stored in a memo.
    Top down approach. The complexity is O(n).
    """
    # Set up a memo list of n + 1 size
    n = int(n)
    memo = [None] * (n + 1)
    def recursion(n, memo):
        if n == 0 or n == 1:
            return n
        if memo[n] == None:
            memo[n] = recursion(n-1, memo) + recursion(n-2, memo)
        return memo[n]
    return recursion(n, memo)