You are viewing a single comment's thread. Return to all comments →
Here is Python 3 solution from my HackerrankPractice repository:
n1, n2, n = map(int, input().split()) sequence = [n1, n2] if n <= 2: print(sequence[n-1]) else: for i in range(n-2): sequence.append(sequence[-2] + sequence[-1]**2) print(sequence[-1])
Feel free to ask if you have any questions :)
Seems like cookies are disabled on this browser, please enable them to open this website
Fibonacci Modified
You are viewing a single comment's thread. Return to all comments →
Here is Python 3 solution from my HackerrankPractice repository:
Feel free to ask if you have any questions :)