DEV Community

Discussion on: Daily Coding Problem #1

Collapse
 
cwetanow profile image
Ivan

In the given example, it would not return true, because the current number is added to the set after checking.
Also I tried it and it returns false.
I am not sure about the hashset building, could also use a dictionary, but it is wasted space.

Collapse
 
bhuntemann profile image
Bjorn Huntemann

Right, I am sorry, I misread. I thought you had built the hash set before you started the comparison pass, not during it. On closer inspection, good solution.