• + 0 comments

    here is my solution ! very time efficient without using lists

    def isFibo(n):
        # Write your code here
        if n==0 or n==1:
            return "IsFibo"
        i_th=0
        i2_th=1
        index=1
        while index<=n:
            if i_th+i2_th==n:
                return "IsFibo"
            i_th = i2_th
            i2_th = index
            index = i_th + i2_th
        if index==n:
            return "IsFibo"
        return "IsNotFibo"