DEV Community

Discussion on: Java Daily Coding Problem #001

Collapse
 
rodiongork profile image
Rodion Gorkovenko

Ah, here is the answer already.

It's O(N) for sure. Sets (based on HashMaps) in Java have O(1) amortized for lookup and insert.