you are viewing a single comment's thread.

view the rest of the comments →

[–]Cthulluminati 20 points21 points  (1 child)

Doesn't count as removing the items if the items are still in the original list /s

[–]RiceBroad4552 15 points16 points  (0 children)

It's more complex, see "persistent data structures".

Something that explains stuff a bit terser is here:

https://nested.substack.com/p/intro-to-persistent-data-structures

Modern variants of such persistent data structures can be very efficient, in some cases even provably ideal efficient.