Contains Duplicate — LeetCode

Soren Rood
Jan 10, 2021

Question:

LeetCode #217

Solution:

hashmap!

Initially, I was using nums.counts(x), but this was exceeding the time limit. Instead, I used a hashmap (constant lookup time) which made the program run faster.

Source code here.

Social links here.

--

--