Floyd's cycle detection
mediumThe fast pointer gains one position per step on the slow one, so they must meet. Then restarting one at the head finds the loop entry - and the algebra behind that is worth seeing once.
Worst
O(n)Space O(1)Loading the floyd's cycle detection engine…