Detect Whether Any Integer Value Repeats
Company: Google
Role: Software Engineer
Category: Coding & Algorithms
Difficulty: easy
Interview Round: Other
### Problem
Return true if any integer value appears at least twice in nums. Return false when all values are distinct. Repeated positions need not be adjacent.
```cpp
bool containsDuplicate(vector<int>& nums);
```
### Examples
```text
Input: nums = [8,-1,3,8]
Output: true
```
```text
Input: nums = [0,4,-2]
Output: false
```
### Constraints
- Length is between 1 and 100000.
- Values lie between -1000000000 and 1000000000.
Overview: Detect any repeated integer by tracking prior values, with explicit expected-time and storage bounds.