3 ms·
I have doubts that destroying the universe can happen in less than O(N).
I have doubts that destroying the universe can happen in less than O(N).
I imagine it's constant time
That part is constant time. The O(N) is the random shuffle
You don't have to destroy the universe. Just kill yourself. You'll therefore only exist in universes where the list is sorted. Quantum suicide sort.