• + 0 comments

    this is my code in python, it exceeded the time with Python3 but passed with PyPy3

    def fibonacciModified(t1, t2, n):
        prev, prev2 = t2, t1
        
        for step in range(2,n):
            prev, prev2 = prev**2 + prev2, prev
    
        return prev