Arrays & Hashing/Easy
Contains DuplicatePRO PASS
Time: O(N)Space: O(N)
Initialize Hash Map
Target is 2. We iterate through nums array and maintain a hash map of { value: index }.
Array Elements & Pointers
1
i=02
i=13
i=21
i=3Live Variables & Invariants
target:2
i:0
current:-
complement:-
Step 1 / 911%
Solution Code
Custom Test Case Runner
Input your custom values and visualize step-by-step trace
Quick Presets:
AI DSA Coach
Contextual Tutor for Contains Duplicate
Hello! I am your AI DSA Tutor for **Contains Duplicate** (Arrays & Hashing). Ask me anything about this algorithm, time complexity, or request a step hint!