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
https://youtu.be/iAe0GgyFrg4
You can find the question here -
https://leetcode.com/problems/find-the-duplicate-number/
This question has been asked in Amazon, Facebook and Google software engineering interviews (according to LeetCode)
Download
0 formats
No download links available.
Floyd’s Algorithm for Cycle Detection | LeetCode 287. Find the Duplicate Number | Part 2 | NatokHD