Leetcode 975. Odd Even Jump Detailed Explanation + Coding (Python)

preview_player
Показать описание
In this video, I walk through, from start to finish, how to do LeetCode 975. Odd Even Jump. This is a HARD difficulty question that was most notably used in a past Google online assessment. I walk through a O(nlogn) time + O(n) memory dynamic programming x stack solution in excruciating detail. At the end, I code up the solution using Python.

PS: Please excuse the sounds in the background. I was recording while construction was happening nearby.

▬ Contents of this video ▬▬▬▬▬▬▬▬▬▬

00:00 Intro
00:35 Reading the question
08:35 Making observations about the question
10:54 Going over an example
19:00 Brute-force algorithm + big-O analysis
21:32 How to make next odd/even jump efficient
24:06 Memoizing next jump indices
35:07 Big-O analysis of memoization
38:01 How to make recursive jumps efficient
41:22 Using DP to avoid repeated recursion
52:28 Coding up the solution (Python3)

▬ About Algorithms Simplified ▬▬▬▬▬▬

I am a software engineer and computer science student who specializes in mathematics, logic, and algorithms. When I was a 2nd-year university student, despite having only *started* programming for 6 months before my first interview, I received multiple FAANG + other software engineering offers following my interview rounds due to my strength in algorithms. I’d like to bring both my passion for mathematical logic and experience interviewing for software engineering roles to you, the viewers, so that you may be better prepared for your next coding interview.

On this channel, I walk through Leetcode interview questions in excruciating detail, so that you can really understand, not memorize. If you enjoy these walkthroughs and explanations, please consider subscribing, as these videos take a lot of work.

▬ Social Media ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬

Рекомендации по теме
Комментарии
Автор

this is my first ever youtube video, so any feedback / suggestions are invited. Which question should i explain in next week's video?

algorithmssimplified
Автор

currently doing some preps and this was by far the best explanation i've seen on the internet.
thank you!

pogramos
Автор

You have the best video explanation on this problem, it's a shame that solving hard leetcode problem is too niche to keep doing.
I hope you never stop teach/sharing knowledge.

lvnd_
Автор

This is hands down by far the best explanation of this question I can find on YouTube! Don't be scared about its one hour-long content. If you are really struggling with this question, this one hour is worth your investment, otherwise you may find yourself jump around among other videos and posts and end up spending more than one hour and are still confused. This one-hour is purely all useful content for sure. Thank you for this easy to follow illustration of the problem. I hope you were my Computer Science teacher!

hangchen
Автор

One of the best videos on this problem. I love the handwritten stuff, very well articulated and color coded. I watched it on 1.5x speed (Suggestion for anyone thinking this video is at slower rate). Great work! and thanks for sharing!

DalonLobo
Автор

thankyou for making the solution so through, such that hard problem sounds like easy once you've went through the explanation :)

akhil_dh_
Автор

Great explanation! Stumbled upon your video after 4-5 videos for this problem and yours was the best. Look forward to seeing more videos!

igowtham
Автор

Great explanation, was able to code the solution just from your explanation alone without seeing your solution. Great Job!

QuantumStagecoach
Автор

Very clear, thank you! I loved that your English is very legible and the sound quality is great

devictr
Автор

Thank you! I'm just starting to interview prep and this helped a lot.

Dholi
Автор

Thank you for such a detailed explanation. Keep posting more. Thank you.

suvrobanerjee
Автор

Thank you for creating such a detailed video!

rexsalezar
Автор

Why did you stop making these videos? You are a great teacher, please come back!

smithcodes
Автор

excruciating detail haha thanks for the help with this !

BBRR
Автор

Thank you for making this video. It was very informative and has been very helpful :)

chriswolf
Автор

Great, great video. Really helpfully and very nicely explained. Was just a tiny bit slow as you were writing so sped it up a little but kudos to how detailed it was. It's a question that would be hard to explain in terms of why certain things work in the algorithm.

vatssv
Автор

Amazing explanation! But if i'm asked this question during an interview I am cooked :(

tenzin
Автор

I am interested in looking at the brute force code.

SiddharthKulkarniN
Автор

feel like if GG give you this question for OA, they want you to fail. Great explanation tho considered there are only a handful of channels solving this hard question.

MinhNguyen-lzpg
Автор

How is the stack approach more efficient? In a worst-case scenario wouldn't it also have a time complexity of O(n^2)? Because we might have to compare an index to every other element in the stack (n operations).

pranavcv
visit shbcf.ru