by copperx · 4y ago · 0 comments
// Daddy, chill. Two passes are still O(N).
// Got a performance issue, hide it in the constant, don't expose it in the f(N) :-)
Same logic as to why you can assemble a set of identical pieces of IKEA furniture faster if you first do step 1 for all pieces, then step 2 for all pieces etc, than if you assemble the pieces one by one.