U know when i seen the idea of how to do it , i literally don't look at your code and begin to apply that idea and literally it worked slight difference in code but logic was same !! I literally don't know what is DP but seeing your video it's very beneficial for intermediate coder thanks Brother❤❤😁😁
fib is a function of the Solution class in leetcode, you can tell when the function has a "self" as an argument. The self basically allows for a distinction of this fib function in comparison to another Solution object's fib function. So, you must call self.fib() to indicate that you wish to call this class's fib function. It will also throw an error saying "fib()" not recognized if you do not use self. It's a good safety measure too
Bro thank for your value bring to the world, but videos about recursion and backtracking I still don't understand ☹️😣😣 can you explain about backtracking in second video for a video just 2 minutes
Master Data Structures & Algorithms For FREE at AlgoMap.io!
U know when i seen the idea of how to do it , i literally don't look at your code and begin to apply that idea and literally it worked slight difference in code but logic was same !!
I literally don't know what is DP but seeing your video it's very beneficial for intermediate coder
thanks Brother❤❤😁😁
I really appreciate your help , you helped me pass the ecpc(egypt's collegiate programming contest) qualification today
Really glad to hear it, and huge congrats!
grateful for your consistency!
Great explanation. Thank you!
Good 😊
Wouldn't the Golden Ratio approach be O(1) time since it isn't iterating through anything?
raising something to power of n is O(logn) since it uses binary search at the backend
why do we use self.fib instead of fib
fib is a function of the Solution class in leetcode, you can tell when the function has a "self" as an argument. The self basically allows for a distinction of this fib function in comparison to another Solution object's fib function. So, you must call self.fib() to indicate that you wish to call this class's fib function. It will also throw an error saying "fib()" not recognized if you do not use self. It's a good safety measure too
@@jorgetomaylla5032 tnxx
this is actually good lol
What do you think of this:
def fib(n, _m={0:0, 1:1}):
try:
y = _m[n]
except KeyError:
y = fib(n-1) + fib(n-2)
_m[n] = y
finally:
return y
What were you thinking by writing an ugly syntax here 😂
Bro thank for your value bring to the world, but videos about recursion and backtracking I still don't understand ☹️😣😣 can you explain about backtracking in second video for a video just 2 minutes
yes same here i could not understand backtracking implementation
Hi