Floyd's tortoise and hare
Function allowing you to find duplicate in an array in linear time and constant space !
Floyd's method is a pretty amazing, allowing you to find a duplicate number. Given an array : "array" (of size n) containing n+1 integers, where each integer is beetween 1 and n (inclusive).
One duplicate number MUST exist (simple logic) : FIND IT.