DEV Community

Discussion on: Scala Daily Coding Problem #001

Collapse
 
awwsmm profile image
Andrew (he/him)

Thanks for pointing that out! How would you solve this in a single pass?

Collapse
 
rodiongork profile image
Rodion Gorkovenko

Putting elements to HashSet and looking up for K-element... It will make O(N) solution.