4 ms·
I've had numerous occasions where doing set() on a python list was demonstrably faster for very large n with an unknown distribution rather than iterating throu
by cgriswald 6y ago
I've had numerous occasions where doing set() on a python list was demonstrably faster for very large n with an unknown distribution rather than iterating through and potentially exiting early. I've always just assumed set() is doing the equivalent thing, but in the underlying C rather than in python.