When you get stuck on a problem throw a hash map at it 👍
C
cynthia.costa8 months, 3 weeks ago
Fibonacci is a strange example, as there is a fixed formula to compute fib(n). No recursion or loops required. Ok there are roots and exponents to take care of, yet still a great way to calculate it.
G
gabriela.miranda8 months, 3 weeks ago
Dead on summary. This is exactly what you'll notice if you get through Neetcode 250.
revadawn749 months, 1 week ago
The 4th solution is how old timers use their old calculators with registers, not lines of formula in moden day calculators.
S
stéphane.perrin9 months, 2 weeks ago
I have no idea what you just said.... but now that I know something was said... it's time to chat google everything
K
kimberlyechoing269 months, 3 weeks ago
When at an interview, present four solutions to every problem. Got it.
T
thomastempest6210 months, 2 weeks ago
Programmer of 10 years over here. I am so glad I don’t have to jump through hoops with this shit where I live and be trusted to Google shit I need, altough if someone asked me to write a fib and said I can’t use a standard library I would go work elsewhere 😅
luisquesada52411 months ago
Currently a senior software engineer, coding for 6 years and never had to do this once
Dude made a career out of Fibonacci series
The last one is pretty sick to pull off.
How to draw a masterpiece: 1. Prepare paper. 2. Prepare pencils and an eraser. 3. Draw.
Naive recursion approach is also called backtracking? It's slightly different from what I learned when I was a sophomore
Why in the 2° code there is an def inside an def?
I am able to solve for top down approach pretty consistently, the intuition for bottom up doesn’t come to me naturally
Lmao "how to solve DP in 4 steps" is to solve it 4 ways without any explanation of how to do any single step. Great vid
Good, now all i have to do is learn dynamic programming now
Thanks for sharing!
Wonderful ❤
one liner: def fib(x): return int(round((((1 + 5**0.5) / 2)**n - ((1 - 5**0.5) / 2)**n) / 5**0.5, 1))
When you get stuck on a problem throw a hash map at it 👍
Fibonacci is a strange example, as there is a fixed formula to compute fib(n). No recursion or loops required. Ok there are roots and exponents to take care of, yet still a great way to calculate it.
Dead on summary. This is exactly what you'll notice if you get through Neetcode 250.
The 4th solution is how old timers use their old calculators with registers, not lines of formula in moden day calculators.
I have no idea what you just said.... but now that I know something was said... it's time to chat google everything
When at an interview, present four solutions to every problem. Got it.
Programmer of 10 years over here. I am so glad I don’t have to jump through hoops with this shit where I live and be trusted to Google shit I need, altough if someone asked me to write a fib and said I can’t use a standard library I would go work elsewhere 😅
Currently a senior software engineer, coding for 6 years and never had to do this once
Remember that tail recursion exists