https://bmmahmud.medium.com/leetcode-problem-217-contains-a-duplicate-with-the-best-solution-12564d27c9d0