def fib(self, N):
        """
        DP with memo
        :type N: int
        :rtype: int
        """
        if N < len(self.memo):
            return self.memo[N]
        for i in range(len(self.memo), N + 1):
            self.memo.append(self.memo[i - 1] + self.memo[i - 2])
        return self.memo[N]

        DP with memo
        :type N: int
        :rtype: int
        
python/509_Fibonacci_Number.py