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
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
Master Data Structures & Algorithms For FREE at AlgoMap.io!
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!
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
Good 😊
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
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 😂
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
Hi