class Solution(object): def fib(self, N): """ :type N: int :rtype: int """ F=[0]*31 F[1]=1 for i in range(2,31): F[i]=F[i-1]+F[i-2] return F[N]
class Solution(object): def fib(self, N): """ :type N: int :rtype: int """ F=[0]*31 F[1]=1 for i in range(2,31): F[i]=F[i-1]+F[i-2] return F[N]