225 - Fibonacci Modified | Dynamic Programming | Hackerrank Solution | Python

preview_player
Показать описание
⭐️ Content Description ⭐️
In this video, I have explained on how to solve fibonacci modified using simple logic in python. This hackerrank problem is a part of Problem Solving | Practice | Algorithms | Dynamic Programming | Fibonacci Modified and solved in python. The complexity of this solution is O (n).

Make a small donation to support the channel 🙏🙏🙏:-

#fibonaccimodified #hackerranksolutions #hackersrealm #fibonacci #hackerrank #python #dynamicprogramming #dp #howtosolve #problemsolving #tutorial #algorithms #datastructures #programming #coding #codinginterview #education #aswin
Рекомендации по теме
Комментарии
Автор

Thanks bro for teaching through your videos.I have learned a lot through your videos bro.Bro i have suggestion that try to take more examples and explain bro.So that it is very easy to undestand.😃😃

swamyswamy
Автор

I initially tried solving this problem using while loop with same logic as you did, but I got runtime error on couple of large test cases. Does that mean that while loops are more inefficient than for loops? If so, then that’s insane.

My initial code was following:

while n > 2:
new = t1 + (t2 ** 2)

n -= 1

t1 = t2
t2 = new

return new

tomshemmer
Автор

just trynna solve it with c++ bro :) you're gonna see the difference

khaipham
Автор

Getting runtime error, i think they have modified the test cases.

utkarshkumar
join shbcf.ru