Hacker News new | ask | show | jobs
by pdonis 2612 days ago
It would be nice if an article on how to ace a coding interview did not have incorrect code in it. AFAICT the set-based algorithm for finding duplicates is wrong; the resulting set will contain items in the list that are not duplicated.
1 comments

It doesn't work. Not just a coding issue either, as the code matches their explanation for this "improved" method.
> It doesn't work.

Yes, I confirmed that by pasting it into the REPL and verifying that it gives the wrong answer for a one-element list. Apparently the author failed to follow his own advice to always test code that you write.