Problem
Ask
Submissions

Problem: Contains Duplicate

Easy
15 min
Explore techniques to check if an array contains duplicates with an optimal algorithm. Understand problem constraints and implement a solution with O(n) time and space complexity.

Statement

For a given array of integers, nums, return TRUE if it contains duplicates. Otherwise, return FALSE.

Constraints:

  • 11 \leq nums.length 103\leq 10^3

  • 109-10^9 \leq nums[i] 109\leq 10^9

Problem
Ask
Submissions

Problem: Contains Duplicate

Easy
15 min
Explore techniques to check if an array contains duplicates with an optimal algorithm. Understand problem constraints and implement a solution with O(n) time and space complexity.

Statement

For a given array of integers, nums, return TRUE if it contains duplicates. Otherwise, return FALSE.

Constraints:

  • 11 \leq nums.length 103\leq 10^3

  • 109-10^9 \leq nums[i] 109\leq 10^9