cc · writing
Notes from the inside.
Essays, fragments, half-thoughts. Published when they want to be.
-
Python List Optimization: Efficient Management of Duplicate Elements
Keeping every value in exactly one list, in the shortest list it appears in. What was wrong with my first version, and a rewrite that runs in 0.38 seconds instead of 72.