Floyd’s Algorithm for Cycle Detection | LeetCode 287. Find the Duplicate Number | Part 2

preview_player
Показать описание
Full explanation of the tortoise and hare algorithm AKA
Floyd’s algorithm for cycle detection.
This is part 2 of the tutorial for how to solve the common coding interview question “Find the Duplicate Number ” [LeetCode 287].

In part 1, I explained how to incrementally optimize the solution from naive to optimal.
Link to part 1

You can find the question here -

This question has been asked in Amazon, Facebook and Google software engineering interviews (according to LeetCode)
Рекомендации по теме
Комментарии
Автор

After watching many videos about this algorithm, none of them answered my questions until I watched this video. I'm really glad to find this channel, keep the good work, you got a new subscriber :)

mohamedhassanin
Автор

Thank you for the algebraic proof, it really helps to understand the algorithm :)

Kernellism
Автор

One of the best explanations for this concept. Thanks for this method ma'am.

Aditya-flsv
Автор

Thank you for a very good explanation, and I really like that you provide proofs, which is rare in this kind of videos

annastley
Автор

best explanation i've seen on yt for floyd's algorithm, such a lifesaver for my ds&a interviews! :-)

douglasso
Автор

Crystal Clear Understanding. Thanks a ton!

amanrubey
Автор

Cool explanation Shiran! Keep on great work!

ivanzhovannik
Автор

the best videos are always those with less views

fettuccine
Автор

I'm requesting you to provide us more solutions of leetcode. Your viedeo is really simple and explains the problem in the easiest way...

UCSAmit
Автор

Can you make algorithms video jus like data structures in 10 mins that would be gold

AbhishekKumar-ytmz
Автор

Hello Shiran, please explain this question 1203. Sort Items by Groups Respecting Dependencies. Thank you.

AB-frqn
Автор

i understood it but i am facing a naive problem here that if i make doubly linked list then this algo. is not working but if i make a circular doubly LL then it works

MuhammadHaseeb-eoch
Автор

😝It takes courage to watch this video completely . 😛

yogeshdharya
Автор

isn't he the guy who gave floyd-warshall algorithm too, guys a genius !!

uptonogood
Автор

Hi Shiran, I watched your other videos and all are great, you really explain the logic behind it and talks about the true points, can you please make Videos on others DSA topics like a course/playlist for preparation, it will help us. Or can please make playlist for blind curated list 75, explaining the pattern to solve any problem and approaching it.

akbarshaikh
Автор

ফেলিসিডেস, এটি মিনাংকাবাউ উদাহরণ। 250 sentadillas son unos Sweetlovee.Monster muchas y un buen ejercicio. 5:25 Dadi dejax ver que hay muy buenos ফলাফল 😍👍

ИванКучер-ны
welcome to shbcf.ru