Contains Duplicate
Try to solve the Contains Duplicate problem.
We'll cover the following
1 of 2
2 of 2
Understand the problem#
Let’s take a moment to make sure you’ve correctly understood the problem. The quiz below helps you check if you’re solving the correct problem:
Contains Duplicate
1
Select the correct option if the following array is passed as input:
nums = [2, 2, 3, 1, 2]
A)
TRUE
B)
FALSE
Question 1 of 30 attempted
Try it yourself#
Implement your solution in the following coding playground:
The optimal solution to this problem runs in O(n) time and takes O(n) space.
Python
usercode > main.py
Contains Duplicate
You might want to go over the Knowing What To Track pattern again.
Solution: Valid Anagram
Solution: Contains Duplicate