https://medium.com/@slicesharpy/leetcode-287-find-the-duplicate-number-from-naive-to-optimal-solution-9543431f778a